Sha256: 5e5611a9c4644eb277a391a2d8dbb0a38a5eee8e1b447bdbb93e39f6400bb3d2

Contents?: true

Size: 1.21 KB

Versions: 40

Compression:

Stored size: 1.21 KB

Contents

Feature: pattern

  Use the pattern option to tell RSpec to look for specs in files that match a pattern other than "**/*_spec.rb".

  Background:
    Given a file named "spec/example_spec.rb" with:
      """ruby
      describe "two specs here" do
        it "passes" do
        end

        it "passes too" do
        end
      end
      """
    And a file named "spec/example_test.rb" with:
      """ruby
      describe "only one spec" do
        it "passes" do
        end
      end
      """

  Scenario: by default, RSpec runs files that match "**/*_spec.rb"
   When I run `rspec`
   Then the output should contain "2 examples, 0 failures"

  Scenario: the --pattern flag makes RSpec run files matching the specified pattern and ignore the default pattern
   When I run `rspec -P "**/*_test.rb"`
   Then the output should contain "1 example, 0 failures"

  Scenario: the --pattern flag can be used to pass in multiple patterns, separated by comma
   When I run `rspec -P "**/*_test.rb,**/*_spec.rb"`
   Then the output should contain "3 examples, 0 failures"

  Scenario: the --pattern flag accepts shell style glob unions
   When I run `rspec -P "**/*_{test,spec}.rb"`
   Then the output should contain "3 examples, 0 failures"

Version data entries

40 entries across 40 versions & 8 rubygems

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