Sha256: 0c8daee1dc387263188167886e2debd80ac90282375f251d1c64844a604e8588

Contents?: true

Size: 903 Bytes

Versions: 30

Compression:

Stored size: 903 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 false to persisted?

  You can also chain `with` on `be_a_new` with a hash of attributes to specify
  the subject has equal attributes.

  Scenario: example spec with four be_a_new 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 examples should all pass

Version data entries

30 entries across 25 versions & 4 rubygems

Version Path
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/matchers/new_record_matcher.feature
rspec-rails-2.11.4 features/matchers/new_record_matcher.feature
gem_repackager-0.1.0 support/gems/rspec-rails-2.11.0/features/matchers/new_record_matcher.feature
rspec-rails-2.11.0 features/matchers/new_record_matcher.feature
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/matchers/new_record_matcher.feature
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/matchers/new_record_matcher.feature
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/matchers/new_record_matcher.feature
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/matchers/new_record_matcher.feature
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/matchers/new_record_matcher.feature
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/matchers/new_record_matcher.feature
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/matchers/new_record_matcher.feature
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/matchers/new_record_matcher.feature
rails-uploader-0.0.4 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/matchers/new_record_matcher.feature
sunrise-cms-0.3.0.rc vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/matchers/new_record_matcher.feature
sunrise-cms-0.3.0.rc vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/matchers/new_record_matcher.feature
rails-uploader-0.0.1 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/matchers/new_record_matcher.feature
rspec-rails-2.10.1 features/matchers/new_record_matcher.feature
rspec-rails-2.10.0 features/matchers/new_record_matcher.feature
rspec-rails-2.9.0 features/matchers/new_record_matcher.feature
rspec-rails-2.9.0.rc2 features/matchers/new_record_matcher.feature