spec/spec_helper.rb in bugsnag-6.3.0.beta.0 vs spec/spec_helper.rb in bugsnag-6.3.0

- old
+ new

@@ -12,21 +12,19 @@ require 'webmock/rspec' require 'rspec/expectations' require 'rspec/mocks' -class BugsnagTestException < RuntimeError; end +class BugsnagTestException < RuntimeError + attr_accessor :skip_bugsnag +end def get_event_from_payload(payload) expect(payload["events"].size).to eq(1) payload["events"].first end -def get_headers_from_payload(payload) - -end - def get_exception_from_payload(payload) event = get_event_from_payload(payload) expect(event["exceptions"].size).to eq(1) event["exceptions"].last end @@ -46,11 +44,10 @@ RSpec.configure do |config| config.order = "random" config.before(:each) do WebMock.stub_request(:post, "https://notify.bugsnag.com/") - WebMock.stub_request(:post, "https://sessions.bugsnag.com/") Bugsnag.instance_variable_set(:@configuration, Bugsnag::Configuration.new) Bugsnag.configure do |bugsnag| bugsnag.api_key = "c9d60ae4c7e70c4b6c4ebd3e8056d2b8" bugsnag.release_stage = "production" @@ -63,24 +60,13 @@ config.after(:each) do Bugsnag.configuration.clear_request_data end end -def have_sent_sessions(&matcher) - have_requested(:post, "https://sessions.bugsnag.com/").with do |request| - if matcher - matcher.call([JSON.parse(request.body), request.headers]) - true - else - raise "no matcher provided to have_sent_sessions (did you use { })" - end - end -end - def have_sent_notification(&matcher) have_requested(:post, "https://notify.bugsnag.com/").with do |request| if matcher - matcher.call([JSON.parse(request.body), request.headers]) + matcher.call JSON.parse(request.body) true else raise "no matcher provided to have_sent_notification (did you use { })" end end