Sha256: 328d6593f58d57d67959d794d49a522ed2595f1fd90da6e13726b558760b0e2a

Contents?: true

Size: 785 Bytes

Versions: 13

Compression:

Stored size: 785 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 I should see "4 examples, 0 failures"

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
rspec-rails-2.0.0.beta.16 features/matchers/new_record_matcher.feature
rspec-rails-2.0.0.beta.15 features/matchers/new_record_matcher.feature
rspec-rails-2.0.0.beta.14.2 features/matchers/new_record_matcher.feature
rspec-rails-2.0.0.beta.14.1 features/matchers/new_record_matcher.feature
rspec-rails-2.0.0.beta.13 features/matchers/new_record_matcher.feature
rspec-rails-2.0.0.beta.12 features/matchers/new_record_matcher.feature
rspec-rails-2.0.0.beta.11 features/matchers/new_record_matcher.feature
rspec-rails-2.0.0.beta.10 features/matchers/new_record_matcher.feature
rspec-rails-2.0.0.beta.9.1 features/matchers/new_record_matcher.feature
rspec-rails-2.0.0.beta.8 features/matchers/new_record_matcher.feature
rspec-rails-2.0.0.beta.7 features/matchers/new_record_matcher.feature
rspec-rails-2.0.0.beta.6 features/matchers/new_record_matcher.feature
rspec-rails-2.0.0.beta.5 features/matchers/new_record_matcher.feature