Skip to content

Commit

Permalink
add MethodDouble
Browse files Browse the repository at this point in the history
  • Loading branch information
dchelimsky committed Mar 16, 2010
1 parent c0e4754 commit 9c21597
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions lib/rspec/mocks/proxy.rb
Expand Up @@ -236,13 +236,19 @@ def find_matching_method_stub(sym, *args)

def expectations_hash
@expectations_hash ||= Hash.new {|h,k|
h[k] = {
:expectations => [],
:stubs => []
}
h[k] = MethodDouble.new(@target, k)
}
end

class MethodDouble < Hash
def initialize(target, sym)
@target = target
@sym = sym
store(:expectations, [])
store(:stubs, [])
end
end

end
end
end

0 comments on commit 9c21597

Please sign in to comment.