Sha256: 3276fb26dadb818e9395a7f73420dc86cb9d0f722a8f4f90f23f5453b246d65b

Contents?: true

Size: 694 Bytes

Versions: 2

Compression:

Stored size: 694 Bytes

Contents

module Orangutan
  module StubInclude
    def __return__ method, return_container
      return *return_container.value if return_container
      return @parent.stub(:"#{@name}/#{method}", :recursive => true) if @recursive
      nil
    end
  
    def __react__ method, args
      yield_container, return_container = nil, nil
      @parent.calls << Call.new(@name, method, args)
      first_match = @parent.first_match(@name, method, args)
      if first_match
        first_match.raiser.execute if first_match.raiser
        yield_container, return_container =  first_match.yield_container, first_match.return_container
      end
      return yield_container, return_container
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
orangutan-0.0.7 lib/orangutan/stub_include.rb
orangutan-0.0.6 lib/orangutan/stub_include.rb