Sha256: 0f603b23b27e81d0f892ff74f217dc4822f9f8e99551c51293520a4a825e79b1
Contents?: true
Size: 420 Bytes
Versions: 49
Compression:
Stored size: 420 Bytes
Contents
require 'spec_helper' describe "Mass assignment" do it "supports setting attributes on lhs" do object = Class.new { attr_accessor :foo, :bar }.new object.foo, object.bar = 100, 200 object.foo.should == 100 object.bar.should == 200 end it "supports setting []= on lhs" do hash = {} hash[:foo], hash[:bar] = 3.142, 42 hash[:foo].should == 3.142 hash[:bar].should == 42 end end
Version data entries
49 entries across 49 versions & 3 rubygems