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.

showing_differences.feature 1.4 kB

2 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. Feature: Showing differences to expected output
  2. Cucumber will helpfully show you the expectation error that your
  3. testing library gives you, in the context of the failing scenario.
  4. When using RSpec, for example, this will show the difference between
  5. the expected and the actual output.
  6. Scenario: Run single failing scenario with default diff enabled
  7. Given a file named "features/failing_expectation.feature" with:
  8. """
  9. Feature: Failing expectation
  10. Scenario: Failing expectation
  11. Given failing expectation
  12. """
  13. And a file named "features/step_definitions/steps.rb" with:
  14. """
  15. Given /^failing expectation$/ do x=1
  16. expect('this').to eq 'that'
  17. end
  18. """
  19. When I run `cucumber -q features/failing_expectation.feature`
  20. Then it should fail with:
  21. """
  22. Feature: Failing expectation
  23. Scenario: Failing expectation
  24. Given failing expectation
  25. expected: "that"
  26. got: "this"
  27. (compared using ==)
  28. (RSpec::Expectations::ExpectationNotMetError)
  29. ./features/step_definitions/steps.rb:2:in `/^failing expectation$/'
  30. features/failing_expectation.feature:4:in `failing expectation'
  31. Failing Scenarios:
  32. cucumber features/failing_expectation.feature:3
  33. 1 scenario (1 failed)
  34. 1 step (1 failed)
  35. """

No Description

Contributors (1)