spec/isolator_spec.rb in caricature-0.5.0 vs spec/isolator_spec.rb in caricature-0.6.0
- old
+ new
@@ -4,10 +4,16 @@
attr_accessor :instance, :expectations
def initialize(instance, expectations)
@instance, @expectations = instance, expectations
end
def send_message(method_name, return_type, *args, &b)
- exp = expectations.find(method_name, *args)
+ internal_send method_name, :internal, return_type, *args, &b
+ end
+ def send_class_message(method_name, return_type, *args, &b)
+ internal_send method_name, :class, return_type, *args, &b
+ end
+ def internal_send(method_name, mode, return_type, *args, &b)
+ exp = expectations.find(method_name, mode, *args)
if exp
res = instance.__send__(method_name, *args, &b) if exp.super_before?
res = exp.execute(*args)
res = instance.__send__(method_name, *args, &b) if !exp.super_before? and exp.call_super?
res
\ No newline at end of file