Skip to content

Commit

Permalink
[#238] Return back steps
Browse files Browse the repository at this point in the history
  • Loading branch information
pnatashap committed Feb 1, 2024
1 parent 438d324 commit 4e4fe39
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions features/step_definitions/steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@
raise "STDOUT doesn't contain '#{txt}':\n#{@stdout}" unless @stdout.include?(txt)
end

Then(/^Stdout is empty$/) do
raise "STDOUT is not empty:\n#{@stdout}" unless @stdout == ''
end

Then(/^XML file "([^"]+)" matches "([^"]+)"$/) do |file, xpath|
raise "File #{file} doesn't exit" unless File.exist?(file)

Expand All @@ -99,6 +103,14 @@
if content.index(substring).nil?
end

Then(/^Exit code is zero$/) do
raise "Non-zero exit code #{@exitstatus}" unless @exitstatus.zero?
end

Then(/^Exit code is not zero$/) do
raise 'Zero exit code' if @exitstatus.zero?
end

When(/^I run bash with$/) do |text|
FileUtils.copy_entry(@cwd, File.join(@dir, 'pdd'))
@stdout = `#{text}`
Expand All @@ -110,3 +122,11 @@
@stdout = `#{text}`
@exitstatus = $CHILD_STATUS.exitstatus
end

Given(/^It is Unix$/) do
pending if Gem.win_platform?
end

Given(/^It is Windows$/) do
pending unless Gem.win_platform?
end

0 comments on commit 4e4fe39

Please sign in to comment.