Sha256: cde2218502d133cc84f581d8c7f9ce8a2be4f7c95fb2cfbb225678dfd21b8cfb

Contents?: true

Size: 885 Bytes

Versions: 7

Compression:

Stored size: 885 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:
      """
      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:
      """
      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

7 entries across 7 versions & 1 rubygems

Version Path
rspec-core-2.0.0.beta.15 features/subject/implicit_subject.feature
rspec-core-2.0.0.beta.14 features/subject/implicit_subject.feature
rspec-core-2.0.0.beta.13 features/subject/implicit_subject.feature
rspec-core-2.0.0.beta.12 features/subject/implicit_subject.feature
rspec-core-2.0.0.beta.11 features/subject/implicit_subject.feature
rspec-core-2.0.0.beta.10 features/subject/implicit_subject.feature
rspec-core-2.0.0.beta.9 features/subject/implicit_subject.feature