Module RR::DoubleDefinitions::DoubleDefinition::TimesDefinitionConstructionMethods
In: lib/rr/double_definitions/double_definition.rb

Methods

Public Instance methods

Double#any_number_of_times sets an that the Double will be called any number of times. This effectively removes the times called expectation from the Doublen

Passing in a block sets the return value.

  mock(subject).method_name.any_number_of_times
any_times(&return_value_block)

Double#at_least sets the expectation that the Double will be called at least n times. It works by creating a TimesCalledExpectation.

Passing in a block sets the return value.

  mock(subject).method_name.at_least(4) {:return_value}

Double#at_most allows sets the expectation that the Double will be called at most n times. It works by creating a TimesCalledExpectation.

Passing in a block sets the return value.

  mock(subject).method_name.at_most(4) {:return_value}

Double#never sets the expectation that the Double will never be called.

This method does not accept a block because it will never be called.

  mock(subject).method_name.never

Double#once sets the expectation that the Double will be called 1 time.

Passing in a block sets the return value.

  mock(subject).method_name.once {:return_value}

Double#times creates an TimesCalledExpectation of the passed in number.

Passing in a block sets the return value.

  mock(subject).method_name.times(4) {:return_value}

Double#twice sets the expectation that the Double will be called 2 times.

Passing in a block sets the return value.

  mock(subject).method_name.twice {:return_value}

[Validate]