lib/fake_sqs/api.rb in fake_sqs-0.0.9 vs lib/fake_sqs/api.rb in fake_sqs-0.0.10

- old
+ new

@@ -14,19 +14,22 @@ InvalidAction = Class.new(ArgumentError) class API - attr_reader :queues + attr_reader :queues, :options def initialize(options = {}) @queues = options.fetch(:queues) @options = options end def call(action, *args) if FakeSQS::Actions.const_defined?(action) - FakeSQS::Actions.const_get(action).new(@options).call(*args) + action = FakeSQS::Actions.const_get(action).new(options) + queues.transaction do + action.call(*args) + end else fail InvalidAction, "Unknown (or not yet implemented) action: #{action}" end end