Sha256: 3059c6e9e771d6db0728a7484702c8ae388192f3d230e5e61e8fd06ba13c5ea2

Contents?: true

Size: 559 Bytes

Versions: 6

Compression:

Stored size: 559 Bytes

Contents

require 'spec_helper'


describe DataMapper::Matchers::HaveMany do
  context '#should' do
    it 'passes if association exists' do
      lambda { Author.should have_many :books}.should_pass
    end

    it 'fails if association does not exist' do
      lambda { Author.should have_many :bad_relations}.should fail_with "expected to have many bad_relations"
    end
  end

  context '#should_not' do
    it 'fails if association exists' do
      lambda { Author.should_not have_many :books}.should fail_with "expected to not have many books"
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
dm-rspec-0.2.0 spec/dm/matchers/have_many_spec.rb
dm-rspec-0.1.2 spec/dm/matchers/have_many_spec.rb
dm-rspec-0.1.1 spec/dm/matchers/have_many_spec.rb
dm-rspec-0.1.0 spec/dm/matchers/have_many_spec.rb
dm-rspec-0.0.2 spec/dm/matchers/have_many_spec.rb
dm-rspec-0.0.1 spec/dm/matchers/have_many_spec.rb