1
0
Fork 0
mirror of https://github.com/awesome-print/awesome_print synced 2023-03-27 23:22:34 -04:00

Fixed set formatting spec for Ruby 1.8.x

This commit is contained in:
Mike Dvorkin 2013-09-24 12:18:44 -07:00
parent 6a820e1f73
commit fb070acab0

View file

@ -523,20 +523,38 @@ EOS
Set.new.ai.should == [].ai Set.new.ai.should == [].ai
end end
it "plain multiline" do if RUBY_VERSION > "1.9"
@set.ai(:plain => true).should == @arr.ai(:plain => true) it "plain multiline" do
end @set.ai(:plain => true).should == @arr.ai(:plain => true)
end
it "plain multiline indented" do it "plain multiline indented" do
@set.ai(:plain => true, :indent => 1).should == @arr.ai(:plain => true, :indent => 1) @set.ai(:plain => true, :indent => 1).should == @arr.ai(:plain => true, :indent => 1)
end end
it "plain single line" do it "plain single line" do
@set.ai(:plain => true, :multiline => false).should == @arr.ai(:plain => true, :multiline => false) @set.ai(:plain => true, :multiline => false).should == @arr.ai(:plain => true, :multiline => false)
end end
it "colored multiline (default)" do it "colored multiline (default)" do
@set.ai.should == @arr.ai @set.ai.should == @arr.ai
end
else # Prior to Ruby 1.9 the order of set values is unpredicatble.
it "plain multiline" do
@set.sort_by{ |x| x.to_s }.ai(:plain => true).should == @arr.sort_by{ |x| x.to_s }.ai(:plain => true)
end
it "plain multiline indented" do
@set.sort_by{ |x| x.to_s }.ai(:plain => true, :indent => 1).should == @arr.sort_by{ |x| x.to_s }.ai(:plain => true, :indent => 1)
end
it "plain single line" do
@set.sort_by{ |x| x.to_s }.ai(:plain => true, :multiline => false).should == @arr.sort_by{ |x| x.to_s }.ai(:plain => true, :multiline => false)
end
it "colored multiline (default)" do
@set.sort_by{ |x| x.to_s }.ai.should == @arr.sort_by{ |x| x.to_s }.ai
end
end end
end end