spec/unit/veritas/relation/operation/binary/directions_spec.rb in veritas-0.0.1 vs spec/unit/veritas/relation/operation/binary/directions_spec.rb in veritas-0.0.2
- old
+ new
@@ -1,16 +1,17 @@
require 'spec_helper'
require File.expand_path('../fixtures/classes', __FILE__)
describe 'Veritas::Relation::Operation::Binary#directions' do
- subject { binary_operation.directions }
+ subject { object.directions }
- let(:left) { Relation.new([ [ :id, Integer ] ], [ [ 1 ] ]).order { |r| r[:id] } }
- let(:right) { Relation.new([ [ :name, String ] ], [ [ 'Dan Kubb' ] ]).order { |r| r[:name] } }
- let(:binary_operation) { BinaryRelationOperationSpecs::Object.new(left, right) }
+ let(:klass) { BinaryRelationOperationSpecs::Object }
+ let(:left) { Relation.new([ [ :id, Integer ] ], [ [ 1 ] ]).order { |r| r[:id] } }
+ let(:right) { Relation.new([ [ :name, String ] ], [ [ 'Dan Kubb' ] ]).order { |r| r[:name] } }
+ let(:object) { klass.new(left, right) }
+ it_should_behave_like 'an idempotent method'
+
it { should be_kind_of(Relation::Operation::Order::DirectionSet) }
- it { should == [ left[:id].asc, right[:name].asc ] }
-
- it_should_behave_like 'an idempotent method'
+ it { should be_empty }
end