spec/unit/veritas/optimizer/algebra/rename/aliases_spec.rb in veritas-optimizer-0.0.3 vs spec/unit/veritas/optimizer/algebra/rename/aliases_spec.rb in veritas-optimizer-0.0.4

- old
+ new

@@ -1,5 +1,7 @@ +# encoding: utf-8 + require 'spec_helper' describe Optimizer::Algebra::Rename, '#aliases' do subject { object.aliases } @@ -11,21 +13,11 @@ before do object.operation.should be_kind_of(Algebra::Rename) end - context 'when the operand is a rename' do - let(:relation) { base.rename(aliases).rename(:other_id => :another_id) } + let(:relation) { base.rename(aliases) } - it { should be_kind_of(Algebra::Rename::Aliases) } + it { should be_kind_of(Algebra::Rename::Aliases) } - it { should == { attribute => attribute.rename(:another_id) } } - end - - context 'when the operand is not a rename' do - let(:relation) { base.rename(aliases) } - - it { should be_kind_of(Algebra::Rename::Aliases) } - - it { should == { attribute => attribute.rename(:other_id) } } - end + it { should equal(relation.aliases) } end