Sha256: b99edb024fcd04b22d83196aee4c31c3e8177da4fad06f3328286eb7741b929b

Contents?: true

Size: 923 Bytes

Versions: 13

Compression:

Stored size: 923 Bytes

Contents

Feature: implicit subject

  If the first argument to the outermost example group is a class, an instance
  of that class is exposed to each example via the subject() method.
  
  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 eq([])
        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 eq([])
          end
        end
      end
      """
    When I run "rspec nested_subject_spec.rb"
    Then the output should contain "1 example, 0 failures"

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
vim-jar-0.1.2.0001 bundler/ruby/1.8/gems/rspec-core-2.1.0/features/subject/implicit_subject.feature
rspec-core-2.4.0 features/subject/implicit_subject.feature
vim-jar-0.1.2 bundler/ruby/1.8/gems/rspec-core-2.1.0/features/subject/implicit_subject.feature
vim-jar-0.1.1 bundler/ruby/1.8/gems/rspec-core-2.1.0/features/subject/implicit_subject.feature
vim-jar-0.1.0 bundler/ruby/1.8/gems/rspec-core-2.1.0/features/subject/implicit_subject.feature
rspec-core-2.3.1 features/subject/implicit_subject.feature
rspec-core-2.3.0 features/subject/implicit_subject.feature
vim-jar-0.0.3 bundler/ruby/1.8/gems/rspec-core-2.1.0/features/subject/implicit_subject.feature
rspec-core-2.2.1 features/subject/implicit_subject.feature
vim-jar-0.0.2 bundler/ruby/1.8/gems/rspec-core-2.1.0/features/subject/implicit_subject.feature
vim-jar-0.0.1 bundler/ruby/1.8/gems/rspec-core-2.1.0/features/subject/implicit_subject.feature
rspec-core-2.2.0 features/subject/implicit_subject.feature
rspec-core-2.1.0 features/subject/implicit_subject.feature