Sha256: eaba4f584db8da1ad391eae1957fa5bfd7bfa88ae5fbd6448fd6d9214d18749c
Contents?: true
Size: 594 Bytes
Versions: 11
Compression:
Stored size: 594 Bytes
Contents
require 'spec_helper' describe Virtus::AttributeSet, '#[]' do subject { object[name] } let(:name) { :name } let(:attribute) { Virtus::Attribute.build(String, :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
11 entries across 11 versions & 1 rubygems