Sha256: 3c7a1c9236f8cac0a3c380ff2b3832aa9d5bf3768d94df99a6f1c1dc11d53b47
Contents?: true
Size: 967 Bytes
Versions: 13
Compression:
Stored size: 967 Bytes
Contents
require 'spec_helper' describe Virtus::Attribute, '#inspect' do subject { object.inspect } let(:object) { described_class.new(:name, options) } let(:options) { { :primitive => primitive, :coercion_method => coercion_method } } let(:primitive) { stub('primitive') } let(:coercion_method) { stub('coercion_method') } context 'with a named attribute class' do let(:described_class) { NamedAttribute = Class.new(Virtus::Attribute) } after do klass = Object.class_eval { remove_const(:NamedAttribute) } Virtus::Attribute.descendants.delete(klass) end it { should eql("#<NamedAttribute @name=:name>") } end context 'with an anonymous attribute class' do let(:described_class) { Class.new(Virtus::Attribute) } it { should eql("#<#{described_class} @name=:name>") } end end
Version data entries
13 entries across 13 versions & 2 rubygems