Sha256: f28e9e5c0e0d7536f4dc9d1aed172b5c9cd39297a51b35dd325e8f338dfdf524
Contents?: true
Size: 746 Bytes
Versions: 25
Compression:
Stored size: 746 Bytes
Contents
module Fakes module ArgBehaviour attr_accessor :return_value,:times_called,:arg_matcher def initialize_matcher_using(args) @arg_matcher = ArgMatchFactory.create_arg_matcher_using(args) end def and_return(item) @return_value = item end def throws(exception) @exception = exception end def capture_args(args) @times_called += 1 @called_args = args end def matches?(args) return @arg_matcher.matches?(args) end def was_called_with?(args) ArgMatchFactory.create_arg_matcher_using(args).matches?(@called_args) end def process return @return_value unless @exception if @exception raise @exception end end end end
Version data entries
25 entries across 25 versions & 1 rubygems