Sha256: 406c0a9a9c480c087ac8b740cd2b998f0d0857c1414e4a89087227f82ac513ba

Contents?: true

Size: 840 Bytes

Versions: 2

Compression:

Stored size: 840 Bytes

Contents

require 'spec_helper'

describe Dicer::Context::Description do
  subject(:description) do
    Dicer::Context::Description.new(Entity) do
      it_behaves_like Cleaner
    end
  end

  describe '#described_class' do
    subject { description.described_class }

    it { should == Entity }
  end

  describe '#behaviors' do
    subject { description.behaviors }

    it { should have(1).behavior }
    it { should include(Cleaner) }
  end

  describe '#delegator' do
    subject { description.delegator }

    it { should be_a(Class) }

    describe 'decorated entity' do
      subject(:entity) { description.delegator.new(Entity.new({})) }

      it { should respond_to(:clean) }
      it { should be_kind_of(Entity) }

      describe '#class' do
        subject { entity.class }

        it { should == Entity }
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dicer-0.1.0 spec/dicer/context/description_spec.rb
dicer-0.0.1 spec/dicer/context/description_spec.rb