Sha256: 668d30b529a859ee5e13e7ccd78fcef7e2188c9bfc52a7140a2605d7d1bfd730

Contents?: true

Size: 909 Bytes

Versions: 17

Compression:

Stored size: 909 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

17 entries across 17 versions & 2 rubygems

Version Path
rspec-core-2.0.1 features/subject/implicit_subject.feature
gemrage-1.0.0 vendor/ruby/1.8/gems/rspec-core-2.0.0/features/subject/implicit_subject.feature
gemrage-0.4.1 vendor/ruby/1.8/gems/rspec-core-2.0.0/features/subject/implicit_subject.feature
gemrage-0.4.0 vendor/ruby/1.8/gems/rspec-core-2.0.0/features/subject/implicit_subject.feature
gemrage-0.3.2 vendor/ruby/1.8/gems/rspec-core-2.0.0/features/subject/implicit_subject.feature
gemrage-0.3.1 vendor/ruby/1.8/gems/rspec-core-2.0.0/features/subject/implicit_subject.feature
gemrage-0.3.0 vendor/ruby/1.8/gems/rspec-core-2.0.0/features/subject/implicit_subject.feature
gemrage-0.2.0 vendor/ruby/1.8/gems/rspec-core-2.0.0/features/subject/implicit_subject.feature
gemrage-0.1.2 vendor/ruby/1.8/gems/rspec-core-2.0.0/features/subject/implicit_subject.feature
gemrage-0.1.1 vendor/ruby/1.8/gems/rspec-core-2.0.0/features/subject/implicit_subject.feature
gemrage-0.1.0 vendor/ruby/1.8/gems/rspec-core-2.0.0/features/subject/implicit_subject.feature
gemrage-0.0.0 vendor/ruby/1.8/gems/rspec-core-2.0.0/features/subject/implicit_subject.feature
rspec-core-2.0.0 features/subject/implicit_subject.feature
rspec-core-2.0.0.rc features/subject/implicit_subject.feature
rspec-core-2.0.0.beta.22 features/subject/implicit_subject.feature
rspec-core-2.0.0.beta.20 features/subject/implicit_subject.feature
rspec-core-2.0.0.beta.19 features/subject/implicit_subject.feature