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.

table_diffing.feature 1.5 kB

2 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. Feature: Table diffing
  2. To allow you to more easily compare data in tables, you are able
  3. to easily diff a table with expected data and see the diff in your
  4. output.
  5. Scenario: Extra row
  6. Given a file named "features/tables.feature" with:
  7. """
  8. Feature: Tables
  9. Scenario: Extra row
  10. Then the table should be:
  11. | x | y |
  12. | a | b |
  13. """
  14. And a file named "features/step_definitions/steps.rb" with:
  15. """
  16. Then /the table should be:/ do |expected| x=1
  17. expected.diff!(table(%{
  18. | x | y |
  19. | a | c |
  20. }))
  21. end
  22. """
  23. When I run `cucumber features/tables.feature --publish-quiet`
  24. Then it should fail with exactly:
  25. """
  26. Feature: Tables
  27. Scenario: Extra row # features/tables.feature:2
  28. Then the table should be: # features/step_definitions/steps.rb:1
  29. | x | y |
  30. | a | b |
  31. Tables were not identical:
  32. | x | y |
  33. | (-) a | (-) b |
  34. | (+) a | (+) c |
  35. (Cucumber::MultilineArgument::DataTable::Different)
  36. ./features/step_definitions/steps.rb:2:in `/the table should be:/'
  37. features/tables.feature:3:in `the table should be:'
  38. Failing Scenarios:
  39. cucumber features/tables.feature:2 # Scenario: Extra row
  40. 1 scenario (1 failed)
  41. 1 step (1 failed)
  42. 0m0.012s
  43. """

No Description

Contributors (1)