Skip to content

Commit

Permalink
Add a test case for a splat of 'obj || []'. This is currently failing…
Browse files Browse the repository at this point in the history
… under Rubinius.
  • Loading branch information
oldgreen authored and rudolf committed May 9, 2012
1 parent 9153ef6 commit 9138807
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spec/ruby/language/splat_spec.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
a = *1; a.should == [1] a = *1; a.should == [1]
end end


it "assigns the splatted object contained into an array when the splatted object is a result of 'obj || []'" do
a = *(1 || []); a.should == [1]
end

it "assigns the returned value of to_a when the splatted object responds to to_a" do it "assigns the returned value of to_a when the splatted object responds to to_a" do
o = mock(Object) o = mock(Object)
o.should_receive(:to_a).once.and_return(["foo"]) o.should_receive(:to_a).once.and_return(["foo"])
Expand Down

0 comments on commit 9138807

Please sign in to comment.