Sha256: 4a375042b99fc51a26fe9e689bfc3300d1f9894d2df3dd6544df7125807acbb4

Contents?: true

Size: 881 Bytes

Versions: 27

Compression:

Stored size: 881 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 examples should all pass

  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 examples should all pass

Version data entries

27 entries across 25 versions & 4 rubygems

Version Path
resque-pool-0.3.0 vendor/bundle/ruby/1.8/gems/rspec-core-2.8.0/features/subject/implicit_subject.feature
resque-pool-0.3.0.beta.2 vendor/bundle/ruby/1.8/gems/rspec-core-2.8.0/features/subject/implicit_subject.feature
horseman-0.0.4 vendor/ruby/1.9.1/gems/rspec-core-2.7.1/features/subject/implicit_subject.feature
horseman-0.0.4 vendor/ruby/1.9.1/gems/rspec-core-2.8.0/features/subject/implicit_subject.feature
horseman-0.0.3 vendor/ruby/1.9.1/gems/rspec-core-2.7.1/features/subject/implicit_subject.feature
horseman-0.0.3 vendor/ruby/1.9.1/gems/rspec-core-2.8.0/features/subject/implicit_subject.feature
horseman-0.0.2 vendor/ruby/1.9.1/gems/rspec-core-2.7.1/features/subject/implicit_subject.feature
rspec-core-2.8.0 features/subject/implicit_subject.feature
nutshell-crm-0.0.6.alpha vendor/bundle/gems/rspec-core-2.7.1/features/subject/implicit_subject.feature
rspec-core-2.8.0.rc2 features/subject/implicit_subject.feature
nutshell-crm-0.0.5 vendor/bundle/gems/rspec-core-2.7.1/features/subject/implicit_subject.feature
nutshell-crm-0.0.4 vendor/bundle/gems/rspec-core-2.7.1/features/subject/implicit_subject.feature
nutshell-crm-0.0.3 vendor/bundle/gems/rspec-core-2.7.1/features/subject/implicit_subject.feature
nutshell-crm-0.0.2 vendor/bundle/gems/rspec-core-2.7.1/features/subject/implicit_subject.feature
nutshell-crm-0.0.1 vendor/bundle/gems/rspec-core-2.7.1/features/subject/implicit_subject.feature
rspec-core-2.8.0.rc1 features/subject/implicit_subject.feature
rspec-core-2.7.1 features/subject/implicit_subject.feature
rspec-core-2.7.0 features/subject/implicit_subject.feature
rspec-core-2.7.0.rc1 features/subject/implicit_subject.feature
rspec-core-2.6.4 features/subject/implicit_subject.feature