Sha256: 837261585172ee2bd401e5c5d111c5b4ce02e82387ebf025e5b7c3f9ef51688c

Contents?: true

Size: 901 Bytes

Versions: 8

Compression:

Stored size: 901 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 "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
        describe "when first created" do
          it "should be empty" do
            subject.should == []
          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/implicit_subject.feature
rspec-core-2.0.0.a1 features/subject/implicit_subject.feature
rspec-1.2.7 features/subject/implicit_subject.feature
rspec-1.2.8 features/subject/implicit_subject.feature
rspec-1.2.4 features/subject/implicit_subject.feature
rspec-1.2.3 features/subject/implicit_subject.feature
rspec-1.2.5 features/subject/implicit_subject.feature
rspec-1.2.6 features/subject/implicit_subject.feature