spec/parent_tracker_spec.rb in compo-0.3.1 vs spec/parent_tracker_spec.rb in compo-0.4.0

- old
+ new

@@ -1,18 +1,17 @@ require 'spec_helper' require 'compo' # Mock implementation of a ParentTracker class MockParentTracker - include Compo::ParentTracker + include Compo::Mixins::ParentTracker # Initialises a MockParentTracker # # @api private def initialize(parent, id_function) - @parent = parent - @id_function = id_function + update_parent(parent, id_function) end end describe MockParentTracker do subject { MockParentTracker.new(parent, id_function) } @@ -47,20 +46,8 @@ allow(new_id_function).to receive(:call).and_return(:new_id) expect(new_id_function).to receive(:call).once subject.update_parent(new_parent, new_id_function) expect(subject.id).to eq(:new_id) - end - end - - describe '#remove_parent' do - it 'sets the parent to an instance of Parentless' do - subject.remove_parent - expect(subject.parent).to be_a(Compo::Parentless) - end - - it 'sets the ID function to one returning nil' do - subject.remove_parent - expect(subject.id).to be_nil end end end