Sha256: d881c1404506f563917d11f6b253102b765fb3520079526eb1eaa1e68f7c2db8

Contents?: true

Size: 1.82 KB

Versions: 12

Compression:

Stored size: 1.82 KB

Contents

Feature: Create example aliases

  Use `config.alias_example_to` to create new example group methods that define
  examples with the configured metadata. You can also specify metadata using
  only symbols.

  Scenario: Use `alias_example_to` to define a custom example name
    Given a file named "alias_example_to_spec.rb" with:
      """ruby
      RSpec.configure do |c|
        c.alias_example_to :task
      end

      RSpec.describe "a task example group" do
        task "does something" do
          expect(5).to eq(5)
        end
      end
      """
    When I run `rspec alias_example_to_spec.rb --format doc`
    Then the output should contain "does something"
    And the examples should all pass


  Scenario: Use `alias_example_to` to define a pending example
    Given a file named "alias_example_to_pending_spec.rb" with:
      """ruby
      RSpec.configure do |c|
        c.alias_example_to :pit, :pending => "Pit alias used"
      end

      RSpec.describe "an example group" do
        pit "does something later on" do
          fail "not implemented yet"
        end
      end
      """
    When I run `rspec alias_example_to_pending_spec.rb --format doc`
    Then the output should contain "does something later on (PENDING: Pit alias used)"
    And the output should contain "0 failures"

  Scenario: Use symbols as metadata
    Given a file named "use_symbols_as_metadata_spec.rb" with:
      """ruby
      RSpec.configure do |c|
        c.alias_example_to :pit, :pending
      end

      RSpec.describe "an example group" do
        pit "does something later on" do
          fail "not implemented yet"
        end
      end
      """
    When I run `rspec use_symbols_as_metadata_spec.rb --format doc`
    Then the output should contain "does something later on (PENDING: No reason given)"
    And the output should contain "0 failures"

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
opal-rspec-1.1.0.alpha3 rspec-core/upstream/features/configuration/alias_example_to.feature
opal-rspec-1.1.0.alpha2 rspec-core/upstream/features/configuration/alias_example_to.feature
opal-rspec-1.1.0.alpha1 rspec-core/upstream/features/configuration/alias_example_to.feature
opal-rspec-1.0.0 rspec-core/upstream/features/configuration/alias_example_to.feature
opal-rspec-1.0.0.alpha1 rspec-core/upstream/features/configuration/alias_example_to.feature
opal-rspec-0.8.0 rspec-core/upstream/features/configuration/alias_example_to.feature
opal-rspec-0.8.0.alpha3 rspec-core/upstream/features/configuration/alias_example_to.feature
opal-rspec-0.8.0.alpha2 rspec-core/upstream/features/configuration/alias_example_to.feature
opal-rspec-0.8.0.alpha1 rspec-core/upstream/features/configuration/alias_example_to.feature
opal-rspec-0.7.1 rspec-core/upstream/features/configuration/alias_example_to.feature
opal-rspec-0.7.0 rspec-core/upstream/features/configuration/alias_example_to.feature
opal-rspec-0.7.0.rc.2 rspec-core/upstream/features/configuration/alias_example_to.feature