spec/piglet/relation/union_spec.rb in piglet-0.2.5 vs spec/piglet/relation/union_spec.rb in piglet-0.3.0
- old
+ new
@@ -4,16 +4,14 @@
describe Piglet::Relation::Union do
before do
- @relation1 = Object.new
- @relation1.extend Piglet::Relation::Relation
- @relation2 = mock('relation2')
- @relation3 = mock('relation3')
- @relation1.stub!(:alias).and_return('relation1')
- @relation2.stub!(:alias).and_return('relation2')
- @relation3.stub!(:alias).and_return('relation3')
+ @interpreter = stub()
+ @interpreter.stub(:next_relation_alias).and_return('relation1', 'relation2', 'relation3')
+ @relation1 = PlainRelation.new(@interpreter)
+ @relation2 = PlainRelation.new(@interpreter)
+ @relation3 = PlainRelation.new(@interpreter)
end
describe '#to_s' do
it 'outputs the names of all the relations (given as separate arguments)' do
pig_latin = @relation1.union(@relation2, @relation3).to_s
\ No newline at end of file