Sha256: c46c4a3699b1a58a912d23e0380abcd0bfc9b1175437acc70858e079b6c6321c

Contents?: true

Size: 1.22 KB

Versions: 32

Compression:

Stored size: 1.22 KB

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 "spec top_level_subject_spec.rb"
    Then the stdout should include "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 "spec nested_subject_spec.rb"
    Then the stdout should include "1 example, 0 failures"

  Scenario: subject with getters
    Given a file named "subject_with_getter_spec.rb" with:
      """
      describe Array do
        describe "when first created" do
          its(:length) { should == 0 }
        end
      end
      """
    When I run "spec subject_with_getter_spec.rb"
    Then the stdout should include "1 example, 0 failures"

Version data entries

32 entries across 32 versions & 11 rubygems

Version Path
rspec-instructure-1.3.3 features/subject/implicit_subject.feature
radiant-1.0.0 ruby-debug/ruby/1.8/gems/rspec-1.3.2/features/subject/implicit_subject.feature
rspec-1.3.2 features/subject/implicit_subject.feature
rspec-1.3.1 features/subject/implicit_subject.feature
rspec-1.3.1.rc features/subject/implicit_subject.feature
rspec-1.3.0 features/subject/implicit_subject.feature
hubbub-0.0.11 lib/vendor/plugins/rspec/features/subject/implicit_subject.feature
hubbub-0.0.10 lib/vendor/plugins/rspec/features/subject/implicit_subject.feature
hubbub-0.0.9 lib/vendor/plugins/rspec/features/subject/implicit_subject.feature
hubbub-0.0.8 lib/vendor/plugins/rspec/features/subject/implicit_subject.feature
hubbub-0.0.6 lib/vendor/plugins/rspec/features/subject/implicit_subject.feature
simple-templater-0.0.1.4 gems/gems/rspec-1.2.9/features/subject/implicit_subject.feature
media-path-0.1.2 vendor/rspec/features/subject/implicit_subject.feature
simple-templater-0.0.1.3 vendor/rspec/features/subject/implicit_subject.feature
pupu-0.0.2.pre vendor/rspec/features/subject/implicit_subject.feature
media-path-0.1.1.pre vendor/rspec/features/subject/implicit_subject.feature
simple-templater-0.0.1.2 vendor/rspec/features/subject/implicit_subject.feature
media-path-0.1.1 vendor/rspec/features/subject/implicit_subject.feature
simple-templater-0.0.1.1 vendor/rspec/features/subject/implicit_subject.feature
pupu-0.0.2 vendor/rspec/features/subject/implicit_subject.feature