Sha256: 541bb4242aafd7055f3523260a7747cc3f480723686dbfc6a3fbbe693b4279f6

Contents?: true

Size: 911 Bytes

Versions: 3

Compression:

Stored size: 911 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 the output should contain "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 the output should contain "1 example, 0 failures"

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rspec-core-2.0.0.beta.18 features/subject/implicit_subject.feature
rspec-core-2.0.0.beta.17 features/subject/implicit_subject.feature
rspec-core-2.0.0.beta.16 features/subject/implicit_subject.feature