You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

command_line_steps.rb 1.9 kB

2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. When('I run `cucumber{}`') do |args|
  2. execute_cucumber(args)
  3. end
  4. When('I run `bundle exec ruby {}`') do |filename|
  5. execute_ruby(filename)
  6. end
  7. When('I run `(bundle exec )rake {word}`') do |task|
  8. execute_rake(task)
  9. end
  10. When('I run the feature with the progress formatter') do
  11. execute_cucumber('features/ --format progress')
  12. end
  13. Then('the exit status should be {int}') do |exit_code|
  14. expect(command_line).to have_exited_with(exit_code)
  15. end
  16. Then('it should {status}') do |status|
  17. expect(command_line).to have_exited_with(status)
  18. end
  19. Then('it should {status} with:') do |status, output|
  20. expect(command_line).to have_exited_with(status)
  21. expect(command_line.all_output).to include_output(output)
  22. end
  23. Then('it should {status} with exactly:') do |status, output|
  24. expect(command_line).to have_exited_with(status)
  25. expect(command_line.all_output).to be_similar_output_than(output)
  26. end
  27. Then('the output should contain:') do |output|
  28. expect(command_line.all_output).to include_output(output)
  29. end
  30. Then('the output should contain {string}') do |output|
  31. expect(command_line.all_output).to include_output(output)
  32. end
  33. Then('the output includes the message {string}') do |message|
  34. expect(command_line.all_output).to include(message)
  35. end
  36. Then('the output should not contain:') do |output|
  37. expect(command_line.all_output).not_to include_output(output)
  38. end
  39. Then('the output should not contain {string}') do |output|
  40. expect(command_line.all_output).not_to include_output(output)
  41. end
  42. Then('the stdout should contain exactly:') do |output|
  43. expect(command_line.stdout).to be_similar_output_than(output)
  44. end
  45. Then('the stderr should contain:') do |output|
  46. expect(command_line.stderr).to include_output(output)
  47. end
  48. Then('the stderr should not contain:') do |output|
  49. expect(command_line.stderr).not_to include_output(output)
  50. end
  51. Then('the stderr should not contain anything') do
  52. expect(command_line.stderr).to be_empty
  53. end

No Description

Contributors (1)