Class: Spec::Mocks::NegativeMessageExpectation

Inherits:
MessageExpectation show all
Defined in:
lib/spec/mocks/message_expectation.rb

Instance Attribute Summary

Attributes inherited from BaseExpectation

#sym

Instance Method Summary collapse

Methods inherited from MessageExpectation

#advise, #any_number_of_times, #at_least, #at_most, #exactly, #expected_messages_received?, #generate_error, #ignoring_args?, #matches_at_least_count?, #matches_at_most_count?, #matches_exact_count?, #matches_name?, #matches_name_but_not_args, #never, #once, #ordered, #similar_messages, #times, #twice, #verify_messages_received, #with

Methods inherited from BaseExpectation

#and_raise, #and_return, #and_throw, #and_yield, #build_child, #called_max_times?, #expected_args, #invoke, #invoke_return_block, #matches

Constructor Details

#initialize(message, expectation_ordering, expected_from, sym, method_block) ⇒ NegativeMessageExpectation

Returns a new instance of NegativeMessageExpectation



334
335
336
# File 'lib/spec/mocks/message_expectation.rb', line 334

def initialize(message, expectation_ordering, expected_from, sym, method_block)
  super(message, expectation_ordering, expected_from, sym, method_block, 0)
end

Instance Method Details

#negative_expectation_for?(sym) ⇒ Boolean

Returns:

  • (Boolean)


338
339
340
# File 'lib/spec/mocks/message_expectation.rb', line 338

def negative_expectation_for?(sym)
  return @sym == sym
end