Sha256: d7dc558c6252076377aded08ef1027cee4c03bee104d141fe30d67d876c6b4a2
Contents?: true
Size: 1.83 KB
Versions: 2
Compression:
Stored size: 1.83 KB
Contents
require 'bundler/setup' Bundler.setup require 'pry-byebug' require 'celluloid' require 'shoryuken' require 'json' require 'multi_xml' require 'dotenv' Dotenv.load if ENV['CODECLIMATE_REPO_TOKEN'] require 'codeclimate-test-reporter' CodeClimate::TestReporter.start end config_file = File.join(File.expand_path('../..', __FILE__), 'spec', 'shoryuken.yml') Shoryuken::EnvironmentLoader.load(config_file: config_file) Shoryuken.logger.level = Logger::UNKNOWN Celluloid.logger.level = Logger::UNKNOWN # I'm not sure whether this is an issue specific to running Shoryuken against github.com/comcast/cmb # as opposed to AWS itself, but sometimes the receive_messages call returns XML that looks like this: # # <ReceiveMessageResponse>\n\t<ReceiveMessageResult>\n\t</ReceiveMessageResult> ... </ReceiveMessageResponse> # # The default MultiXML parser is ReXML, which seems to mishandle \n\t chars. Nokogiri seems to be # the only one that correctly ignore this whitespace. MultiXml.parser = :nokogiri class TestWorker include Shoryuken::Worker shoryuken_options queue: 'default' def perform(sqs_msg, body); end end RSpec.configure do |config| config.filter_run_excluding slow: true unless ENV['SPEC_ALL'] config.before do Shoryuken::Client.class_variable_set :@@queues, {} Shoryuken::Client.class_variable_set :@@visibility_timeouts, {} Shoryuken::Client.sqs = nil Shoryuken::Client.sqs_resource = nil Shoryuken::Client.sns = nil Shoryuken.queues.clear Shoryuken.options[:concurrency] = 1 Shoryuken.options[:delay] = 1 Shoryuken.options[:timeout] = 1 Shoryuken.options[:aws].delete(:receive_message) TestWorker.get_shoryuken_options.clear TestWorker.get_shoryuken_options['queue'] = 'default' Shoryuken.worker_registry.clear Shoryuken.register_worker('default', TestWorker) end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
shoryuken-1.0.2 | spec/spec_helper.rb |
shoryuken-1.0.1 | spec/spec_helper.rb |