Sha256: 2c197a2e4b583d6c6335a2cd05af30575bf728168f7dc86ea3515f38ea951f23

Contents?: true

Size: 1.29 KB

Versions: 33

Compression:

Stored size: 1.29 KB

Contents

Feature: pattern option

  By default, RSpec loads files matching the pattern:

      "spec/**/*_spec.rb"

  Use the `--pattern` option to declare a different pattern.

  Scenario: default pattern
    Given a file named "spec/example_spec.rb" with:
      """ruby
      describe "addition" do
        it "adds things" do
          (1 + 2).should eq(3)
        end
      end
      """
    When I run `rspec`
    Then the output should contain "1 example, 0 failures"

  Scenario: override the default pattern on the command line
    Given a file named "spec/example.spec" with:
      """ruby
      describe "addition" do
        it "adds things" do
          (1 + 2).should eq(3)
        end
      end
      """
    When I run `rspec --pattern "spec/**/*.spec"`
    Then the output should contain "1 example, 0 failures"

  Scenario: override the default pattern in configuration
    Given a file named "spec/spec_helper.rb" with:
      """ruby
        RSpec.configure do |config|
          config.pattern << ',**/*.spec'
        end
      """
    And a file named "spec/example.spec" with:
      """ruby
      describe "addition" do
        it "adds things" do
          (1 + 2).should eq(3)
        end
      end
      """
    When I run `rspec -rspec_helper`
    Then the output should contain "1 example, 0 failures"

Version data entries

33 entries across 33 versions & 8 rubygems

Version Path
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.4.0/gems/rspec-core-2.14.8/features/command_line/pattern_option.feature
vagrant-unbundled-1.9.5.1 vendor/bundle/ruby/2.4.0/gems/rspec-core-2.14.8/features/command_line/pattern_option.feature
vagrant-unbundled-1.9.1.1 vendor/bundle/ruby/2.4.0/gems/rspec-core-2.14.8/features/command_line/pattern_option.feature
vagrant-unbundled-1.8.5.2 vendor/bundle/ruby/2.3.0/gems/rspec-core-2.14.8/features/command_line/pattern_option.feature
vagrant-unbundled-1.8.5.1 vendor/bundle/ruby/2.3.0/gems/rspec-core-2.14.8/features/command_line/pattern_option.feature
vagrant-unbundled-1.8.4.2 vendor/bundle/ruby/2.3.0/gems/rspec-core-2.14.8/features/command_line/pattern_option.feature
vagrant-unbundled-1.8.4.1 vendor/bundle/ruby/2.3.0/gems/rspec-core-2.14.8/features/command_line/pattern_option.feature
vagrant-unbundled-1.8.1.1 vendor/bundle/ruby/2.3.0/gems/rspec-core-2.14.8/features/command_line/pattern_option.feature
vagrant-cloudstack-1.1.0 vendor/bundle/gems/rspec-core-2.14.8/features/command_line/pattern_option.feature
rspec-core-2.99.2 features/command_line/pattern_option.feature
dxruby_rp5-0.0.4 spec/vendor/rspec-core-2.14.7/features/command_line/pattern_option.feature
rspec-core-2.99.1 features/command_line/pattern_option.feature
rspec-core-2.99.0 features/command_line/pattern_option.feature
rspec-core-2.99.0.rc1 features/command_line/pattern_option.feature
rspec-core-2.14.8 features/command_line/pattern_option.feature
rspec-core-2.99.0.beta2 features/command_line/pattern_option.feature
mango-0.8.0 vendor/bundler/ruby/2.1.0/gems/rspec-core-2.14.7/features/command_line/pattern_option.feature
mango-0.7.1 vendor/bundler/ruby/2.0.0/gems/rspec-core-2.14.7/features/command_line/pattern_option.feature
dxruby_rp5-0.0.3 spec/vendor/rspec-core-2.14.7/features/command_line/pattern_option.feature
tuktuk-rails-0.0.10 vendor/bundle/ruby/2.0.0/gems/rspec-core-2.14.7/features/command_line/pattern_option.feature