Class: DevelopWithPassion::Fakes::IgnoreSet
- Inherits:
-
Object
- Object
- DevelopWithPassion::Fakes::IgnoreSet
show all
- Includes:
- ArgBehaviour
- Defined in:
- lib/developwithpassion_fakes/ignore_set.rb
Instance Attribute Summary
Attributes included from ArgBehaviour
#return_value, #times_called
Instance Method Summary
collapse
#and_return, #capture_args
Constructor Details
Returns a new instance of IgnoreSet.
6
7
8
9
10
11
12
13
14
|
# File 'lib/developwithpassion_fakes/ignore_set.rb', line 6
def initialize
array :arg_sets do|a|
a.mutator :capture_args do|args|
@times_called += 1
@arg_sets << args
end
end
@times_called = 0
end
|
Instance Method Details
#matches?(args) ⇒ Boolean
16
17
18
|
# File 'lib/developwithpassion_fakes/ignore_set.rb', line 16
def matches?(args)
return true
end
|
#was_called_with?(args) ⇒ Boolean
21
22
23
|
# File 'lib/developwithpassion_fakes/ignore_set.rb', line 21
def was_called_with?(args)
return @arg_sets.select{|set| set == args}.count > 0
end
|