Sha256: 4eed759f2a40a272790f97e9af67a738200068608657b0abb7ea5f1c307c95ce

Contents?: true

Size: 798 Bytes

Versions: 3

Compression:

Stored size: 798 Bytes

Contents

Feature: be_a_new matcher

  The be_a_new matcher accepts a class and passes if the subject is an instance
  of that class that returns true to new_record?

  Scenario: example spec with four possibilities 
    Given a file named "spec/models/widget_spec.rb" with:
      """
      require "spec_helper"

      describe Widget do
        context "when initialized" do
          subject { Widget.new }
          it { should be_a_new(Widget) }
          it { should_not be_a_new(String) }
        end
        context "when saved" do
          subject { Widget.create }
          it { should_not be_a_new(Widget) }
          it { should_not be_a_new(String) }
        end
      end
      """
    When I run "rspec spec/models/widget_spec.rb"
    Then the output should contain "4 examples, 0 failures"

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rspec-rails-2.0.0.beta.19 features/matchers/new_record_matcher.feature
rspec-rails-2.0.0.beta.18 features/matchers/new_record_matcher.feature
rspec-rails-2.0.0.beta.17 features/matchers/new_record_matcher.feature