Sha256: 58e74a766da701f342b474b12e549f9639d8df05466dd4fd3016fb3069e21889

Contents?: true

Size: 1.45 KB

Versions: 51

Compression:

Stored size: 1.45 KB

Contents

Feature: alias_example_to

  Use `config.alias_example_to` to create new example group methods
  that define examples with the configured metadata.

  If you set the `treat_symbols_as_metadata_keys_with_true_values` config option
  to `true`, you can specify metadata using only symbols.

  Scenario: Use alias_example_to to define focused example
    Given a file named "alias_example_to_spec.rb" with:
      """ruby
      RSpec.configure do |c|
        c.alias_example_to :fit, :focused => true
        c.filter_run :focused => true
      end

      describe "an example group" do
        it "does one thing" do
        end

        fit "does another thing" do
        end
      end
      """
    When I run `rspec alias_example_to_spec.rb --format doc`
    Then the output should contain "does another thing"
    And the output should not contain "does one thing"

  Scenario: use symbols as metadata
    Given a file named "use_symbols_as_metadata_spec.rb" with:
      """ruby
      RSpec.configure do |c|
        c.treat_symbols_as_metadata_keys_with_true_values = true
        c.alias_example_to :fit, :focused
        c.filter_run :focused
      end

      describe "an example group" do
        it "does one thing" do
        end

        fit "does another thing" do
        end
      end
      """
    When I run `rspec use_symbols_as_metadata_spec.rb --format doc`
    Then the output should contain "does another thing"
    And the output should not contain "does one thing"

Version data entries

51 entries across 51 versions & 13 rubygems

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