Module: DevelopWithPassion::Fakes::ArgBehaviour

Included in:
ArgSet, IgnoreSet
Defined in:
lib/developwithpassion_fakes/arg_behaviour.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#return_valueObject

Returns the value of attribute return_value.



4
5
6
# File 'lib/developwithpassion_fakes/arg_behaviour.rb', line 4

def return_value
  @return_value
end

#times_calledObject

Returns the value of attribute times_called.



4
5
6
# File 'lib/developwithpassion_fakes/arg_behaviour.rb', line 4

def times_called
  @times_called
end

Instance Method Details

#and_return(item) ⇒ Object



6
7
8
# File 'lib/developwithpassion_fakes/arg_behaviour.rb', line 6

def and_return(item)
  @return_value = item
end

#capture_args(args) ⇒ Object



10
11
12
13
# File 'lib/developwithpassion_fakes/arg_behaviour.rb', line 10

def capture_args(args)
  @times_called += 1
  @called_args = args
end

#matches?(args) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/developwithpassion_fakes/arg_behaviour.rb', line 15

def matches?(args)
  return @args == args
end

#was_called_with?(args) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/developwithpassion_fakes/arg_behaviour.rb', line 19

def was_called_with?(args)
  return @called_args == args
end