Module: RSpec::Message::Within::ExpectationPatch::InstanceMethods

Defined in:
lib/rspec/message/within.rb

Instance Method Summary collapse

Instance Method Details

#verify_messages_receivedObject



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/rspec/message/within.rb', line 19

def verify_messages_received
  @within_time ||= nil

  if @within_time
    time = Time.now + @within_time
    while time > Time.now
      break if expected_messages_received? and !negative?
      sleep 0
    end
  end

  orig_verify_messages_received
end

#within(time) ⇒ Object



33
34
35
36
# File 'lib/rspec/message/within.rb', line 33

def within(time)
  @within_time = time
  self
end