diff --git a/spec/services/deprecation_warnings/development_handler_spec.rb b/spec/services/deprecation_warnings/development_handler_spec.rb index 85e08cbbeb8..daf11e1c5fa 100644 --- a/spec/services/deprecation_warnings/development_handler_spec.rb +++ b/spec/services/deprecation_warnings/development_handler_spec.rb @@ -3,26 +3,15 @@ module DeprecationWarnings describe DevelopmentHandler do context ".call" do - subject(:call) { described_class.call(message, callstack, deprecation_horizon, gem_name) } + subject(:call) { described_class.call(message, callstack = [], deprecation_horizon = "6.0", gem_name = "Rails") } let(:message) { "dummy deprecation message" } - let(:callstack) { [] } - let(:deprecation_horizon) { "6.0" } - let(:gem_name) { "Rails" } let(:rails_logger) { Rails.logger } - let(:slack_service) { SlackService.new(url: "dummy-url") } - let(:deploy_env) { ENV["DEPLOY_ENV"] } before do allow(Rails).to receive(:logger).and_return(rails_logger) allow(rails_logger).to receive(:warn) - - allow(Raven).to receive(:capture_message) - allow(Raven).to receive(:capture_exception) - - allow(SlackService).to receive(:new).with(url: anything).and_return(slack_service) - allow(slack_service).to receive(:send_notification) end it "emits a warning to the application logs" do diff --git a/spec/services/deprecation_warnings/test_handler_spec.rb b/spec/services/deprecation_warnings/test_handler_spec.rb index d4de5438f1a..56435116dc8 100644 --- a/spec/services/deprecation_warnings/test_handler_spec.rb +++ b/spec/services/deprecation_warnings/test_handler_spec.rb @@ -3,24 +3,9 @@ module DeprecationWarnings describe TestHandler do context ".call" do - subject(:call) { described_class.call(message, callstack, deprecation_horizon, gem_name) } + subject(:call) { described_class.call(message, callstack = [], deprecation_horizon = "6.0", gem_name = "Rails") } let(:message) { "dummy deprecation message" } - let(:callstack) { [] } - let(:deprecation_horizon) { "6.0" } - let(:gem_name) { "Rails" } - - let(:rails_logger) { Rails.logger } - let(:slack_service) { SlackService.new(url: "dummy-url") } - let(:deploy_env) { ENV["DEPLOY_ENV"] } - - before do - allow(Raven).to receive(:capture_message) - allow(Raven).to receive(:capture_exception) - - allow(SlackService).to receive(:new).with(url: anything).and_return(slack_service) - allow(slack_service).to receive(:send_notification) - end it "logs message to stderr" do expect { call }.to output("#{message}\n").to_stderr