Sha256: 677e7103dec0be401f185f750b1cc4a607d98d0611912297f987d0d2669021d7

Contents?: true

Size: 875 Bytes

Versions: 116

Compression:

Stored size: 875 Bytes

Contents

require 'spec_helper'

describe Module do

  describe 'each_delegate' do
    context "with correct params" do
      before(:each) do
        @klass = Class.new do
          
          each_delegate :bli, :bla, :blu, :to => :@some_enumerable
          
          def initialize some_enumerable
            @some_enumerable = some_enumerable
          end
          
        end
      end
      it 'should send each a bli' do
        bli = stub :bli
        delegating = @klass.new [bli, bli, bli, bli]
        
        bli.should_receive(:bli).exactly(4).times
        
        delegating.bli
      end
    end
    context "without correct params" do
      it 'should send each a bli' do
        lambda do
          Class.new do
            each_delegate :bli, :bla, :blu # :to missing
          end
        end.should raise_error(ArgumentError)
      end
    end
  end
  
end

Version data entries

116 entries across 116 versions & 1 rubygems

Version Path
picky-2.4.0 spec/lib/internals/extensions/module_spec.rb
picky-2.3.0 spec/lib/internals/extensions/module_spec.rb
picky-2.2.1 spec/lib/internals/extensions/module_spec.rb
picky-2.2.0 spec/lib/internals/extensions/module_spec.rb
picky-2.1.2 spec/lib/internals/extensions/module_spec.rb
picky-2.1.1 spec/lib/internals/extensions/module_spec.rb
picky-2.1.0 spec/lib/internals/extensions/module_spec.rb
picky-2.0.0 spec/lib/internals/extensions/module_spec.rb
picky-2.0.0.pre3 spec/lib/internals/extensions/module_spec.rb
picky-2.0.0.pre2 spec/lib/internals/extensions/module_spec.rb
picky-2.0.0.pre1 spec/lib/internals/extensions/module_spec.rb
picky-1.5.4 spec/lib/internals/extensions/module_spec.rb
picky-1.5.3 spec/lib/internals/extensions/module_spec.rb
picky-1.5.2 spec/lib/internals/extensions/module_spec.rb
picky-1.5.1 spec/lib/internals/extensions/module_spec.rb
picky-1.5.0 spec/lib/internals/extensions/module_spec.rb
picky-1.4.3 spec/lib/internals/extensions/module_spec.rb
picky-1.4.2 spec/lib/internals/extensions/module_spec.rb
picky-1.4.1 spec/lib/extensions/module_spec.rb
picky-1.4.0 spec/lib/extensions/module_spec.rb