Sha256: 6a68aa4bccc5dc021d379064422661e5b98dc618e9596efec2d9679071dede92
Contents?: true
Size: 812 Bytes
Versions: 16
Compression:
Stored size: 812 Bytes
Contents
require 'spec_helper' describe Virtus::DescendantsTracker, '#add_descendant' do subject { object.add_descendant(descendant) } let(:described_class) { Class.new { extend Virtus::DescendantsTracker } } let(:object) { Class.new(described_class) } let(:descendant) { Class.new } it { should equal(object) } it 'prepends the class to the descendants' do object.descendants << original = Class.new expect { subject }.to change { object.descendants.dup }. from([ original ]). to([ descendant, original ]) end it 'prepends the class to the superclass descendants' do expect { subject }.to change { object.superclass.descendants.dup }. from([ object ]). to([ descendant, object ]) end end
Version data entries
16 entries across 16 versions & 2 rubygems