Sha256: 7db2684d51ce3c3562bc5a710dba0a5ba517299d6f109438194f690b82afebc8

Contents?: true

Size: 888 Bytes

Versions: 1

Compression:

Stored size: 888 Bytes

Contents

require 'spec_helper'

describe Dicer::Delegator do
  let(:delegator) { Dicer::Delegator.make(Entity, [Cleaner]) }
  let(:entity) { Entity.new(:test => 1) }

  subject(:delegated) { delegator.new(entity) }

  it { should == entity }

  describe '#__id__' do
    subject { delegated.__id__ }

    it { should_not == entity.__id__ }
  end

  describe '#test' do
    subject { delegated.test }

    it { should == 1 }
  end

  describe '#id' do
    subject { delegated.id }

    it { should == entity.id }
  end

  describe '#clean' do
    subject { delegated.clean }

    it { should be_true }
  end

  describe '#pure' do
    subject(:pure) { delegated.pure }

    it { should == delegated }
    it { should == entity }

    describe '#object_id' do
      subject { pure.object_id }

      it { should_not == delegated.object_id }
      it { should == entity.object_id }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dicer-0.3.0 spec/dicer/delegator_spec.rb