Sha256: 532450cdf4c5473a986852d24e3e347e62c25ea09b10781733f34b6353ded55c

Contents?: true

Size: 627 Bytes

Versions: 3

Compression:

Stored size: 627 Bytes

Contents

require 'spec_helper'


describe DataMapper::Matchers::HaveManyAndBelongTo do
  context '#should' do
    it 'passes if association exists' do
      lambda { Book.should have_many_and_belong_to :genres}.should_pass
    end

    it 'fails if association does not exist' do
      lambda { Book.should have_many_and_belong_to :authors}.should
	fail_with "expected to have many and belong to authors"
    end
  end

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
dm-rspec-0.1.0 spec/dm/matchers/have_many_and_belong_to_spec.rb
dm-rspec-0.0.2 spec/dm/matchers/have_many_and_belong_to_spec.rb
dm-rspec-0.0.1 spec/dm/matchers/have_many_and_belong_to_spec.rb