Sha256: 2c7455aa986d03388561867e823f14edfa600f73ee65fcd881faed7f57bad95b

Contents?: true

Size: 611 Bytes

Versions: 17

Compression:

Stored size: 611 Bytes

Contents

require 'spec_helper'

describe Virtus::DescendantsTracker, '#descendants' do
  subject { object.descendants }

  let(:described_class) { Class.new { extend Virtus::DescendantsTracker } }
  let(:object)          { described_class                                 }

  context 'when there are no descendants' do
    it_should_behave_like 'an idempotent method'

    it { should be_empty }
  end

  context 'when there are descendants' do
    let!(:descendant) { Class.new(object) }  # trigger the class inhertance

    it_should_behave_like 'an idempotent method'

    it { should eql([ descendant ]) }
  end
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
fragrant-0.0.5 vendor/bundle/ruby/1.9.1/gems/virtus-0.5.2/spec/unit/virtus/descendants_tracker/descendants_spec.rb
virtus-0.5.2 spec/unit/virtus/descendants_tracker/descendants_spec.rb
virtus-0.5.1 spec/unit/virtus/descendants_tracker/descendants_spec.rb
virtus-0.5.0 spec/unit/virtus/descendants_tracker/descendants_spec.rb
virtus-0.4.2 spec/unit/virtus/descendants_tracker/descendants_spec.rb
virtus-0.4.1 spec/unit/virtus/descendants_tracker/descendants_spec.rb
virtus-0.4.0 spec/unit/virtus/descendants_tracker/descendants_spec.rb
virtus-0.3.0 spec/unit/virtus/descendants_tracker/descendants_spec.rb
virtus-0.2.0 spec/unit/virtus/descendants_tracker/descendants_spec.rb
virtus-0.1.0 spec/unit/virtus/descendants_tracker/descendants_spec.rb
virtus-0.0.10 spec/unit/virtus/descendants_tracker/descendants_spec.rb
virtus-0.0.9 spec/unit/virtus/descendants_tracker/descendants_spec.rb
virtus-0.0.8 spec/unit/virtus/descendants_tracker/descendants_spec.rb
virtus-0.0.7 spec/unit/virtus/descendants_tracker/descendants_spec.rb
virtus-0.0.6 spec/unit/virtus/descendants_tracker/descendants_spec.rb
virtus-0.0.5 spec/unit/virtus/descendants_tracker/descendants_spec.rb
virtus-0.0.4 spec/unit/virtus/descendants_tracker/descendants_spec.rb