Sha256: a2b7028d8a6a0572c336aa18677d10c4008a18ccb8a0c23905237c0bc17c997a

Contents?: true

Size: 973 Bytes

Versions: 7

Compression:

Stored size: 973 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 "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:
      """
      require 'rspec/expectations'

      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

7 entries across 7 versions & 1 rubygems

Version Path
rspec-core-2.0.0.a9 features/subject/implicit_subject.feature
rspec-core-2.0.0.a8 features/subject/implicit_subject.feature
rspec-core-2.0.0.a7 features/subject/implicit_subject.feature
rspec-core-2.0.0.a6 features/subject/implicit_subject.feature
rspec-core-2.0.0.a5 features/subject/implicit_subject.feature
rspec-core-2.0.0.a4 features/subject/implicit_subject.feature
rspec-core-2.0.0.a3 features/subject/implicit_subject.feature