Module: Orangutan::StubInclude

Included in:
StubBase
Defined in:
lib/orangutan/stub_include.rb

Instance Method Summary collapse

Instance Method Details

#__react__(method, args) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/orangutan/stub_include.rb', line 9

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

#__return__(method, return_container) ⇒ Object



3
4
5
6
7
# File 'lib/orangutan/stub_include.rb', line 3

def __return__ method, return_container
  return *return_container.value if return_container
  return @parent.stub(:"#{@name}/#{method}", :recursive => true) if @recursive
  nil
end