Sha256: a12374dcb861d50f76b65f1425e6ef3eee0b34b85563aaa9d7ad859426360d7a
Contents?: true
Size: 643 Bytes
Versions: 8
Compression:
Stored size: 643 Bytes
Contents
require 'spec_helper' describe Virtus::ClassMethods, '#inherited' do subject { Class.new(object) } let(:object) { Class.new { extend Virtus::ClassMethods } } it 'includes an AttributesAccessor module' do descendant = subject # return the descendant's attribute accessor modules (superclass + own) modules = descendant.ancestors.grep(Virtus::AttributesAccessor) modules.size.should be(2) # remove the superclass' attribute accessor module modules -= object.ancestors.grep(Virtus::AttributesAccessor) # the descendant should have it's own attribute accessor module modules.size.should be(1) end end
Version data entries
8 entries across 8 versions & 1 rubygems