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.

strict_mode.feature 1.9 kB

2 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. Feature: Strict mode
  2. Using the `--strict` flag will cause cucumber to fail unless all the
  3. step definitions have been defined.
  4. Background:
  5. Given a file named "features/missing.feature" with:
  6. """
  7. Feature: Missing
  8. Scenario: Missing
  9. Given this step passes
  10. """
  11. And a file named "features/pending.feature" with:
  12. """
  13. Feature: Pending
  14. Scenario: Pending
  15. Given this step is pending
  16. """
  17. Scenario: Fail with --strict due to undefined step
  18. When I run `cucumber -q features/missing.feature --strict`
  19. Then it should fail with:
  20. """
  21. Feature: Missing
  22. Scenario: Missing
  23. Given this step passes
  24. Undefined step: "this step passes" (Cucumber::Core::Test::Result::Undefined)
  25. features/missing.feature:3:in `this step passes'
  26. Undefined Scenarios:
  27. cucumber features/missing.feature:2
  28. 1 scenario (1 undefined)
  29. 1 step (1 undefined)
  30. """
  31. Scenario: Fail with --strict due to pending step
  32. Given the standard step definitions
  33. When I run `cucumber -q features/pending.feature --strict`
  34. Then it should fail with:
  35. """
  36. Feature: Pending
  37. Scenario: Pending
  38. Given this step is pending
  39. TODO (Cucumber::Pending)
  40. ./features/step_definitions/steps.rb:3:in `/^this step is pending$/'
  41. features/pending.feature:3:in `this step is pending'
  42. Pending Scenarios:
  43. cucumber features/pending.feature:2
  44. 1 scenario (1 pending)
  45. 1 step (1 pending)
  46. """
  47. Scenario: Succeed with --strict
  48. Given the standard step definitions
  49. When I run `cucumber -q features/missing.feature --strict`
  50. Then it should pass with:
  51. """
  52. Feature: Missing
  53. Scenario: Missing
  54. Given this step passes
  55. 1 scenario (1 passed)
  56. 1 step (1 passed)
  57. """

No Description

Contributors (1)