spec/integrations/resque_spec.rb in bugsnag-6.11.1 vs spec/integrations/resque_spec.rb in bugsnag-6.12.0
- old
+ new
@@ -4,10 +4,11 @@
describe 'Bugsnag::Resque', :order => :defined do
before do
unless defined?(::Resque)
@mocked_resque = true
class ::Resque
+ VERSION = '9.9.9'
class Worker
end
class Failure
class Bugsnag
end
@@ -42,14 +43,18 @@
fork_check = double("fork_check")
expect(::Resque::Worker).to receive(:new).with(:bugsnag_fork_check).and_return(fork_check)
expect(fork_check).to receive(:fork_per_job?).and_return(true)
expect(::Resque).to receive(:after_fork).and_yield
expect(Bugsnag.configuration).to receive(:app_type=).with("resque")
+ runtime = {}
+ expect(Bugsnag.configuration).to receive(:runtime_versions).and_return(runtime)
expect(Bugsnag.configuration).to receive(:default_delivery_method=).with(:synchronous)
#Kick off
require './lib/bugsnag/integrations/resque'
+
+ expect(runtime).to eq("resque" => "9.9.9")
end
it "can configure" do
expect(Bugsnag::Resque).to receive(:add_failure_backend)
expect(Bugsnag).to receive(:configure).and_yield
@@ -69,17 +74,19 @@
expect(report).to receive(:severity=).with("error")
expect(report).to receive(:severity_reason=).with({
:type => Bugsnag::Report::UNHANDLED_EXCEPTION_MIDDLEWARE,
:attributes => Bugsnag::Resque::FRAMEWORK_ATTRIBUTES
})
+ expected_context = "class@queue"
meta_data = double('meta_data')
expect(report).to receive(:meta_data).and_return(meta_data)
expect(meta_data).to receive(:merge!).with({
- :context => "class@queue",
+ :context => expected_context,
:payload => {
"class" => "class"
}
})
+ expect(report).to receive(:context=).with(expected_context)
expect(Bugsnag).to receive(:notify).with(exception, true).and_yield(report)
resque.save
end
after do