Sha256: 85bf6a77fe958b6f838fc9534f926084d57ef3c9cd4b47e8914ac8d810864436

Contents?: true

Size: 782 Bytes

Versions: 47

Compression:

Stored size: 782 Bytes

Contents

Feature: implicit receiver

  When `should` is called in an example without an explicit receiver, it is
  invoked against the subject (explicit or implicit).

  Scenario: implicit subject
    Given a file named "example_spec.rb" with:
      """ruby
      describe Array do
        describe "when first created" do
          it { should be_empty }
        end
      end
      """
    When I run `rspec example_spec.rb`
    Then the examples should all pass

  Scenario: explicit subject
    Given a file named "example_spec.rb" with:
      """ruby
      describe Array do
        describe "with 3 items" do
          subject { [1,2,3] }
          it { should_not be_empty }
        end
      end
      """
    When I run `rspec example_spec.rb`
    Then the examples should all pass

Version data entries

47 entries across 47 versions & 13 rubygems

Version Path
rspec-core-2.13.1 features/subject/implicit_receiver.feature
rspec-core-2.13.0 features/subject/implicit_receiver.feature
remq-0.0.4 vendor/bundle/gems/rspec-core-2.12.2/features/subject/implicit_receiver.feature
remq-0.0.3 vendor/bundle/gems/rspec-core-2.12.2/features/subject/implicit_receiver.feature
rspec-core-2.12.2 features/subject/implicit_receiver.feature
rspec-core-2.12.1 features/subject/implicit_receiver.feature
rspec-core-2.12.0 features/subject/implicit_receiver.feature