Skip to content

Commit

Permalink
Inlined #call_double.
Browse files Browse the repository at this point in the history
  • Loading branch information
btakita committed Sep 8, 2009
1 parent a6a3908 commit eeba6ae
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/rr/double_injection_dispatch.rb
Expand Up @@ -12,7 +12,14 @@ def initialize(double_injection, args, block)
def call
space.record_call(subject, method_name, args, block)
if double
call_double
double.method_call(args)
call_yields
return_value = call_implementation
if definition.after_call_proc
extract_subject_from_return_value(definition.after_call_proc.call(return_value))
else
return_value
end
else
double_not_found_error
end
Expand Down Expand Up @@ -45,13 +52,6 @@ def find_double_to_attempt
return nil
end

def call_double
double.method_call(args)
call_yields
return_value = call_implementation
definition.after_call_proc ? extract_subject_from_return_value(definition.after_call_proc.call(return_value)) : return_value
end

def call_yields
if definition.yields_value
if block
Expand Down

0 comments on commit eeba6ae

Please sign in to comment.