Sha256: 5e999495e631838939b12aadae030bc2ceb5d97521bd6645c2a9f16b38dc13c1
Contents?: true
Size: 706 Bytes
Versions: 13
Compression:
Stored size: 706 Bytes
Contents
require 'spec_helper' describe Virtus::ClassMethods, '#const_missing' do let(:object) { Class.new { extend Virtus::ClassMethods } } context 'with a constant name that is known' do subject { object.class_eval 'String' } it 'returns the constant' do subject.should be(String) end end context 'with a constant name that corresponds to a Virtus::Attribute' do subject { object.class_eval 'Boolean' } it 'determines the correct type' do subject.should be(Virtus::Attribute::Boolean) end end context 'with a constant name that is unknown' do subject { object.class_eval 'Unknown' } specify { expect { subject }.to raise_error(NameError) } end end
Version data entries
13 entries across 13 versions & 2 rubygems