Sha256: 96a920ced093e67c329b65c9de5ac1e85e3c9656b370d1cc36d1263886f7cfae

Contents?: true

Size: 939 Bytes

Versions: 8

Compression:

Stored size: 939 Bytes

Contents

Feature: explicit subject

  You can override the implicit subject using the subject() method.
  
  Scenario: subject in top level group
    Given a file named "top_level_subject_spec.rb" with:
      """
      describe Array, "with some elements" do
        subject { [1,2,3] }
        it "should have the prescribed elements" do
          subject.should == [1,2,3]
        end
      end
      """
    When I run "spec top_level_subject_spec.rb"
    Then the stdout should match "1 example, 0 failures"

  Scenario: subject in a nested group
    Given a file named "nested_subject_spec.rb" with:
      """
      describe Array do
        subject { [1,2,3] }
        describe "with some elements" do
          it "should have the prescribed elements" do
            subject.should == [1,2,3]
          end
        end
      end
      """
    When I run "spec nested_subject_spec.rb"
    Then the stdout should match "1 example, 0 failures"

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
rspec-core-2.0.0.a2 features/subject/explicit_subject.feature
rspec-core-2.0.0.a1 features/subject/explicit_subject.feature
rspec-1.2.7 features/subject/explicit_subject.feature
rspec-1.2.8 features/subject/explicit_subject.feature
rspec-1.2.5 features/subject/explicit_subject.feature
rspec-1.2.6 features/subject/explicit_subject.feature
rspec-1.2.4 features/subject/explicit_subject.feature
rspec-1.2.3 features/subject/explicit_subject.feature