spec/unit/axiom/relation/gateway/restrict_spec.rb in axiom-do-adapter-0.1.0 vs spec/unit/axiom/relation/gateway/restrict_spec.rb in axiom-do-adapter-0.2.0

- old
+ new

@@ -4,26 +4,24 @@ require 'axiom/relation/gateway' describe Relation::Gateway, '#restrict' do subject { object.restrict(args, &block) } - let(:adapter) { mock('Adapter') } - let(:relation) { mock('Relation', :restrict => response) } - let(:response) { mock('New Relation', :kind_of? => true) } - let!(:object) { described_class.new(adapter, relation) } - let(:args) { stub } - let(:block) { lambda { |context| } } + let(:adapter) { double('Adapter') } + let(:relation) { double('Relation', restrict: response) } + let(:response) { double('New Relation', :kind_of? => true) } + let!(:object) { described_class.new(adapter, relation) } + let(:args) { double } + let(:block) { ->(context) {} } it_should_behave_like 'a unary relation method' it 'forwards the arguments to relation#restrict' do - relation.should_receive(:restrict).with(args) + expect(relation).to receive(:restrict).with(args) subject end - unless testing_block_passing_broken? - it 'forwards the block to relation#restrict' do - relation.should_receive(:restrict) { |_args, &proc| proc.should equal(block) } - subject - end + it 'forwards the block to relation#restrict' do + expect(relation).to receive(:restrict) { |_args, &proc| expect(proc).to equal(block) } + subject end end