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.

rake_task.feature 3.4 kB

2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. Feature: Rake task
  2. In order to ease the development process
  3. As a developer and CI server administrator
  4. Cucumber features should be executable via Rake
  5. Background:
  6. And a file named "features/missing_step_definitions.feature" with:
  7. """
  8. Feature: Sample
  9. Scenario: Wanted
  10. Given I want to run this
  11. Scenario: Unwanted
  12. Given I don't want this ran
  13. """
  14. Scenario: rake task with a defined profile
  15. Given the following profile is defined:
  16. """
  17. foo: --quiet --no-color features/missing_step_definitions.feature:3
  18. """
  19. And a file named "Rakefile" with:
  20. """
  21. require 'cucumber/rake/task'
  22. Cucumber::Rake::Task.new do |t|
  23. t.profile = "foo"
  24. end
  25. """
  26. When I run `rake cucumber`
  27. Then it should pass with:
  28. """
  29. Feature: Sample
  30. Scenario: Wanted
  31. Given I want to run this
  32. 1 scenario (1 undefined)
  33. 1 step (1 undefined)
  34. """
  35. Scenario: rake task without a profile
  36. Given a file named "Rakefile" with:
  37. """
  38. require 'cucumber/rake/task'
  39. Cucumber::Rake::Task.new do |t|
  40. t.cucumber_opts = %w{--quiet --no-color}
  41. end
  42. """
  43. When I run `rake cucumber`
  44. Then it should pass with:
  45. """
  46. Feature: Sample
  47. Scenario: Wanted
  48. Given I want to run this
  49. Scenario: Unwanted
  50. Given I don't want this ran
  51. 2 scenarios (2 undefined)
  52. 2 steps (2 undefined)
  53. """
  54. Scenario: rake task with a defined profile and cucumber_opts
  55. Given the following profile is defined:
  56. """
  57. bar: ['features/missing_step_definitions.feature:3']
  58. """
  59. And a file named "Rakefile" with:
  60. """
  61. require 'cucumber/rake/task'
  62. Cucumber::Rake::Task.new do |t|
  63. t.profile = "bar"
  64. t.cucumber_opts = %w{--quiet --no-color}
  65. end
  66. """
  67. When I run `rake cucumber`
  68. Then it should pass with:
  69. """
  70. Feature: Sample
  71. Scenario: Wanted
  72. Given I want to run this
  73. 1 scenario (1 undefined)
  74. 1 step (1 undefined)
  75. """
  76. Scenario: respect requires
  77. Given an empty file named "features/support/env.rb"
  78. And an empty file named "features/support/dont_require_me.rb"
  79. And the following profile is defined:
  80. """
  81. no_bomb: features/missing_step_definitions.feature:3 --require features/support/env.rb --verbose
  82. """
  83. And a file named "Rakefile" with:
  84. """
  85. require 'cucumber/rake/task'
  86. Cucumber::Rake::Task.new do |t|
  87. t.profile = "no_bomb"
  88. t.cucumber_opts = %w{--quiet --no-color}
  89. end
  90. """
  91. When I run `rake cucumber`
  92. Then it should pass
  93. And the output should not contain:
  94. """
  95. * features/support/dont_require_me.rb
  96. """
  97. Scenario: feature files with spaces
  98. Given a file named "features/spaces are nasty.feature" with:
  99. """
  100. Feature: The futures green
  101. Scenario: Orange
  102. Given this is missing
  103. """
  104. And a file named "Rakefile" with:
  105. """
  106. require 'cucumber/rake/task'
  107. Cucumber::Rake::Task.new do |t|
  108. t.cucumber_opts = %w{--quiet --no-color}
  109. end
  110. """
  111. When I run `rake cucumber`
  112. Then it should pass with:
  113. """
  114. Feature: The futures green
  115. Scenario: Orange
  116. Given this is missing
  117. """

No Description

Contributors (1)