spec/dm/matchers/have_one_spec.rb in dm-rspec-0.2.4 vs spec/dm/matchers/have_one_spec.rb in dm-rspec-0.3.0
- old
+ new
@@ -1,25 +1,25 @@
require 'spec_helper'
describe DataMapper::Matchers::HaveOne do
context '#should' do
it 'passes if association exists' do
- lambda { Book.should have_one :foreword}.should_pass
+ lambda { expect(Book).to have_one :foreword}.should_pass
end
it 'fails if association does not exist' do
- lambda { Author.should have_one :book}.should fail_with "expected to have one book"
+ expect { expect(Author).to have_one :book}.to fail_with "expected to have one book"
end
end
context '#should_not' do
it 'fails if association exists' do
- lambda { Book.should_not have_one :foreword}.should fail_with "expected not to have one foreword"
+ expect { expect(Book).not_to have_one :foreword}.to fail_with "expected not to have one foreword"
end
end
context 'instance of model' do
it 'should pass' do
- lambda { Book.new.should have_one :foreword}.should_pass
+ lambda { expect(Book.new).to have_one :foreword}.should_pass
end
end
end