Sha256: 647e7549cb54654b94cb608ee647c54999eb1187ec61890bb9ac3d16361ce9fd

Contents?: true

Size: 953 Bytes

Versions: 8

Compression:

Stored size: 953 Bytes

Contents

Feature: implicit subject

  The first argument to the outermost example group block is
  made available to each example as an implicit subject of
  that example.
  
  Scenario: subject in top level group
    Given a file named "top_level_subject_spec.rb" with:
      """
      require 'rspec/expectations'

      describe Array, "when first created" do
        it "should be empty" do
          subject.should == []
        end
      end
      """
    When I run "rspec top_level_subject_spec.rb"
    Then I should see "1 example, 0 failures"

  Scenario: subject in a nested group
    Given a file named "nested_subject_spec.rb" with:
      """
      require 'rspec/expectations'

      describe Array do
        describe "when first created" do
          it "should be empty" do
            subject.should == []
          end
        end
      end
      """
    When I run "rspec nested_subject_spec.rb"
    Then I should see "1 example, 0 failures"

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rspec-core-2.0.0.beta.7 features/subject/implicit_subject.feature
rspec-core-2.0.0.beta.6 features/subject/implicit_subject.feature
rspec-core-2.0.0.beta.5 features/subject/implicit_subject.feature
rspec-core-2.0.0.beta.4 features/subject/implicit_subject.feature
rspec-core-2.0.0.beta.3 features/subject/implicit_subject.feature
rspec-core-2.0.0.beta.2 features/subject/implicit_subject.feature
rspec-core-2.0.0.beta.1 features/subject/implicit_subject.feature
rspec-core-2.0.0.a10 features/subject/implicit_subject.feature