Sha256: d900f5891d02c70fe78bc66aeab1484db85f04f71fb2d6b1f22e0342e8c57baa

Contents?: true

Size: 751 Bytes

Versions: 2

Compression:

Stored size: 751 Bytes

Contents

require 'spec_helper'

describe Dicer::Contextable do
  let(:entity) { Entity.new({}) }
  let(:cleaning_context) { CleaningContext.new }

  describe '#in_context' do
    subject { entity.in_context(cleaning_context) }

    it { should respond_to(:clean) }
    it { should == entity }

    context 'with block' do
      it do
        entity.in_context(cleaning_context) do |cleaner|
          cleaner.should respond_to(:clean)
        end
      end
    end
  end

  describe '#behaves_like' do
    subject { entity.behaves_like(Cleaner) }

    it { should respond_to(:clean) }

    context 'with block' do
      it do
        entity.behaves_like(Cleaner) do |cleaner|
          cleaner.should respond_to(:clean)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dicer-0.3.0 spec/dicer/contextable_spec.rb
dicer-0.2.0 spec/dicer/contextable_spec.rb