lib/orangutan/chantek.rb in orangutan-0.0.2 vs lib/orangutan/chantek.rb in orangutan-0.0.3
- old
+ new
@@ -2,11 +2,11 @@
require 'orangutan/expectation'
require 'orangutan/call'
module Orangutan
class Chantek
- attr_reader :calls
+ attr_reader :calls, :stubs
def initialize
@calls = []
@expectations = {}
@stubs= {}
@@ -19,12 +19,12 @@
include params[:clr_interface]
params[:clr_interface].to_clr_type.get_methods.each do |m_info|
snake = m_info.name.scan(/[A-Z][a-z0-9]*/).map {|a|a.downcase}.join('_').to_sym
define_method snake do |*args|
yield_container, return_container = __react__(snake, args)
- yield yield_container.value if yield_container && block_given?
- __return__(method, return_container)
+ yield *yield_container.value if yield_container && block_given?
+ return __return__(method, return_container)
end
end
end
end
@stubs[name] = c.new(name, self, params[:recursive])
@@ -43,8 +43,9 @@
if expectations_for_name
expectations_for_name.each do |expectation|
return expectation if expectation.matches?(method, *args)
end
end
+ nil
end
end
end
\ No newline at end of file