/vendor/bundle/jruby/2.1/gems/rspec-core-2.14.8/features/configuration/show_failures_in_pending_blocks.feature

https://github.com/delowong/logstash · Gherkin Specification · 61 lines · 54 code · 7 blank · 0 comment · 2 complexity · 7e3c31a02a216f41891aa3d78ed05443 MD5 · raw file

  1. Feature: show_failures_in_pending_blocks
  2. Use the show_failures_in_pending_blocks option to run the code in pending blocks while keeping the tests pending.
  3. RSpec.configure { |c| c.show_failures_in_pending_blocks = true }
  4. Background:
  5. Given a file named "spec/spec_helper.rb" with:
  6. """ruby
  7. RSpec.configure {|c| c.show_failures_in_pending_blocks = true}
  8. """
  9. Scenario: by default, code in pending examples is not exercised
  10. Given a file named "spec/example_spec.rb" with:
  11. """ruby
  12. describe "fails" do
  13. pending "code will not be exercised" do
  14. fail
  15. end
  16. end
  17. """
  18. When I run `rspec spec/example_spec.rb`
  19. Then the output should not contain "Failure/Error: pending { fail }"
  20. Scenario: by default, code in pending blocks inside examples is not exercised
  21. Given a file named "spec/example_spec.rb" with:
  22. """ruby
  23. describe "fails" do
  24. it "code will not be exercised" do
  25. pending { fail }
  26. end
  27. end
  28. """
  29. When I run `rspec spec/example_spec.rb`
  30. Then the output should not contain "Failure/Error: pending { fail }"
  31. Scenario: when turned on, pending code blocks inside examples are exercised
  32. Given a file named "spec/example_spec.rb" with:
  33. """ruby
  34. require "spec_helper"
  35. describe "fails" do
  36. it "code will be exercised" do
  37. pending { fail }
  38. end
  39. end
  40. """
  41. When I run `rspec spec/example_spec.rb`
  42. Then the output should contain "Failure/Error: pending { fail }"
  43. Scenario: when turned on, code inside pending examples is not exercised
  44. Given a file named "spec/example_spec.rb" with:
  45. """ruby
  46. require "spec_helper"
  47. describe "fails" do
  48. pending "code will not be exercised" do
  49. fail
  50. end
  51. end
  52. """
  53. When I run `rspec spec/example_spec.rb`
  54. Then the output should not contain "Failure/Error: pending { fail }"