File: dry_run.feature

package info (click to toggle)
ruby-rspec 3.13.0c0e0m0s1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,856 kB
  • sloc: ruby: 70,868; sh: 1,423; makefile: 99
file content (29 lines) | stat: -rw-r--r-- 833 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Feature: `--dry-run` option

  Use the `--dry-run` option to have RSpec print your suite's formatter output
  without running any examples or hooks.

  Scenario: Using `--dry-run`
    Given a file named "spec/dry_run_spec.rb" with:
      """ruby
      RSpec.configure do |c|
        c.before(:suite) { puts "before suite" }
        c.after(:suite)  { puts "after suite"  }
      end

      RSpec.describe "dry run" do
        before(:context) { fail }
        before(:example) { fail }

        it "fails in example" do
          fail
        end

        after(:example) { fail }
        after(:context) { fail }
      end
      """
    When I run `rspec --dry-run`
    Then the output should contain "1 example, 0 failures"
     And the output should not contain "before suite"
     And the output should not contain "after suite"