spec/unit/axiom/function/predicate/enumerable/call_spec.rb in axiom-0.1.0 vs spec/unit/axiom/function/predicate/enumerable/call_spec.rb in axiom-0.1.1

- old
+ new

@@ -4,33 +4,33 @@ describe Function::Predicate::Enumerable, '#call' do subject { object.call(tuple) } let(:described_class) { Class.new(Function) { include Function::Binary } } - let(:header) { Relation::Header.coerce([ [ :id, Integer ] ]) } - let(:tuple) { Tuple.new(header, [ 1 ]) } + let(:header) { Relation::Header.coerce([[:id, Integer]]) } + let(:tuple) { Tuple.new(header, [1]) } before do described_class.class_eval { include Function::Predicate::Enumerable } end context 'with an enumerable of non-callable objects' do - let(:object) { described_class.new(header[:id], [ 1 ]) } + let(:object) { described_class.new(header[:id], [1]) } it 'sends the left and right value to self.class.call' do - response = mock('#call response') - described_class.should_receive(:call).with(1, [ 1 ]).and_return(response) - should equal(response) + response = double('#call response') + described_class.should_receive(:call).with(1, [1]).and_return(response) + should be(response) end end context 'with an enumerable of callable objects' do - let(:callable) { proc { 1 } } - let(:object) { described_class.new(header[:id], [ callable ]) } + let(:callable) { proc { 1 } } + let(:object) { described_class.new(header[:id], [callable]) } it 'sends the left and right value to self.class.call' do - response = mock('#call response') - described_class.should_receive(:call).with(1, [ 1 ]).and_return(response) - should equal(response) + response = double('#call response') + described_class.should_receive(:call).with(1, [1]).and_return(response) + should be(response) end end end