test_lib/provider/base.rb in message-driver-0.6.1 vs test_lib/provider/base.rb in message-driver-0.7.0
- old
+ new
@@ -9,15 +9,11 @@
@broker_name ||= MessageDriver::Broker::DEFAULT_BROKER_NAME
end
def pause_if_needed(seconds = 0.1)
seconds *= 10 if ENV['CI'] == 'true'
- case BrokerConfig.current_adapter
- when :in_memory
- else
- sleep seconds
- end
+ sleep seconds unless BrokerConfig.current_adapter == :in_memory
end
def fetch_messages(destination_name, _opts = {})
destination = fetch_destination(destination_name)
pause_if_needed
@@ -47,10 +43,10 @@
when String, Symbol
MessageDriver::Client[broker_name].find_destination(destination)
when MessageDriver::Destination::Base
destination
else
- fail "didn't understand destination #{destination.inspect}"
+ raise "didn't understand destination #{destination.inspect}"
end
end
def fetch_current_adapter_context
MessageDriver::Client[broker_name].current_adapter_context