Sha256: e2c3d532e81f4f2001cac82adef96e46ada30370e8dc71d49acbe88b1cbf4980
Contents?: true
Size: 586 Bytes
Versions: 13
Compression:
Stored size: 586 Bytes
Contents
require 'spec_helper' describe Virtus::AttributeSet, '#[]' do subject { object[name] } let(:name) { :name } let(:attribute) { mock('Attribute', :name => name) } let(:attributes) { [ attribute ] } let(:parent) { described_class.new } let(:object) { described_class.new(parent, attributes) } it { should equal(attribute) } it 'allows indexed access to attributes by the string representation of their name' do object[name.to_s].should equal(attribute) end end
Version data entries
13 entries across 13 versions & 2 rubygems