diff options
Diffstat (limited to 'spec/ruby/language/variables_spec.rb')
-rw-r--r-- | spec/ruby/language/variables_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/ruby/language/variables_spec.rb b/spec/ruby/language/variables_spec.rb index 868603eb88..7c2c7889f1 100644 --- a/spec/ruby/language/variables_spec.rb +++ b/spec/ruby/language/variables_spec.rb @@ -354,6 +354,16 @@ describe "Multiple assignment" do a.should be_an_instance_of(Array) end + it "unfreezes the array returned from calling 'to_a' on the splatted value" do + obj = Object.new + def obj.to_a + [1,2].freeze + end + res = *obj + res.should == [1,2] + res.frozen?.should == false + end + it "consumes values for an anonymous splat" do a = 1 (* = *a).should == [1] |