test/unit/processor_test.rb in aeden-refinery-0.10.8 vs test/unit/processor_test.rb in aeden-refinery-0.10.10
- old
+ new
@@ -11,16 +11,18 @@
@waiting_queue = stub('Queue(waiting)')
@error_queue = stub('Queue(error)')
@done_queue = stub('Queue(done)')
- Refinery::Daemon.any_instance.stubs(:require).with('java').raises(LoadError)
- Refinery::Daemon.any_instance.stubs(:queue).with(
- 'sample_waiting').returns(@waiting_queue)
- Refinery::Daemon.any_instance.stubs(:queue).with(
- 'sample_error').returns(@error_queue)
- Refinery::Daemon.any_instance.stubs(:queue).with(
- 'sample_done').returns(@done_queue)
+ provider = stub('QueueProvider')
+ if defined?(Typica)
+ Typica::Sqs::QueueService.stubs(:new).returns(provider)
+ else
+ RightAws::SqsGen2.stubs(:new).returns(provider)
+ end
+ provider.stubs(:queue).with('sample_waiting').returns(@waiting_queue)
+ provider.stubs(:queue).with('sample_error').returns(@error_queue)
+ provider.stubs(:queue).with('sample_done').returns(@done_queue)
end
should "initialize" do
assert_nothing_raised do
@waiting_queue.stubs(:receive)
Refinery::Processor.new(@server, 'sample', @settings)
\ No newline at end of file