Sha256: 51816b0a1af7885d224851d18caa804aa49d7d27c711cd0afe4fddea5bc88fed

Contents?: true

Size: 604 Bytes

Versions: 12

Compression:

Stored size: 604 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

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

  let(:described_class) { Class.new { extend 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

12 entries across 10 versions & 4 rubygems

Version Path
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/descendants_tracker-0.0.4/spec/unit/descendants_tracker/descendants_spec.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/descendants_tracker-0.0.4/spec/unit/descendants_tracker/descendants_spec.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/descendants_tracker-0.0.4/spec/unit/descendants_tracker/descendants_spec.rb
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/descendants_tracker-0.0.4/spec/unit/descendants_tracker/descendants_spec.rb
grape-extra_validators-1.0.0 vendor/bundle/ruby/2.4.0/gems/descendants_tracker-0.0.4/spec/unit/descendants_tracker/descendants_spec.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/descendants_tracker-0.0.4/spec/unit/descendants_tracker/descendants_spec.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/descendants_tracker-0.0.4/spec/unit/descendants_tracker/descendants_spec.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/descendants_tracker-0.0.4/spec/unit/descendants_tracker/descendants_spec.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/descendants_tracker-0.0.4/spec/unit/descendants_tracker/descendants_spec.rb
descendants_tracker-0.0.4 spec/unit/descendants_tracker/descendants_spec.rb
descendants_tracker-0.0.3 spec/unit/descendants_tracker/descendants_spec.rb
descendants_tracker-0.0.2 spec/unit/descendants_tracker/descendants_spec.rb