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