File: descendants_spec.rb

package info (click to toggle)
ruby-descendants-tracker 0.0.4-2.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 212 kB
  • sloc: ruby: 86; makefile: 2
file content (24 lines) | stat: -rw-r--r-- 606 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# 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