rubyspec/rubyspec — pull request #278 by alexdowad (2014-06-27 03:50:22+00:00)
Title: Test splat assignment from a subclass of Array to a single lvalue

This is designed to catch a couple differences in behavior I have observed between MRI and Rubinius. In MRI irb:

```
2.1.1 :001 > class ArraySubclass < Array; end
=> nil
2.1.1 :002 > a = *(ArraySubclass.new([1,2]))
=> [1, 2]
2.1.1 :003 > a.class
=> Array
```

In rbx:

```
rbx-2.2.9 :001 > class ArraySubclass < Array; end
=> nil
rbx-2.2.9 :002 > a = *(ArraySubclass.new([1,2]))
=> [1, 2]
rbx-2.2.9 :003 > a.class
=> ArraySubclass
```

In short, when doing a splat assignment to a single lvalue, Rubinius just assigns a reference to the *splatted array*. MRI *always* creates a new Array.

(I am working on a gem where this minor difference causes the tests to fail on rbx.)