Skip to content

Commit

Permalink
Remove deprecated logger attribute in Appsignal.AuthCheck
Browse files Browse the repository at this point in the history
As deprecated in #245.
Part of #202.
  • Loading branch information
jeffkreeftmeijer authored and tombruijn committed Jan 15, 2021
1 parent f39dfa6 commit a20a771
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 31 deletions.
10 changes: 2 additions & 8 deletions lib/appsignal/auth_check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,10 @@ class AuthCheck
# https://push.appsignal.com/1/auth
ACTION = "auth".freeze

attr_reader :config, :logger
attr_reader :config

def initialize(config, logger = nil)
def initialize(config)
@config = config
if logger # rubocop:disable Style/GuardClause
Appsignal::Utils::DeprecationMessage.message \
"`Appsignal::AuthCheck.new`'s `logger` argument will be removed " \
"in the next major version. Please configure the logger " \
"using `Appsignal.logger`."
end
end

# Perform push api validation request and return response status code.
Expand Down
23 changes: 0 additions & 23 deletions spec/lib/appsignal/auth_check_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,6 @@ def build_uri_query_string(hash)
end.join("&")
end

describe ".new" do
describe "with logger argument" do
let(:err_stream) { std_stream }
let(:stderr) { err_stream.read }
let(:log_stream) { std_stream }
let(:log) { log_contents(log_stream) }

it "logs and prints a deprecation message" do
Appsignal.logger = test_logger(log_stream)

capture_std_streams(std_stream, err_stream) do
Appsignal::AuthCheck.new(config, Appsignal.logger)
end

deprecation_message =
"`Appsignal::AuthCheck.new`'s `logger` argument " \
"will be removed in the next major version."
expect(stderr).to include "appsignal WARNING: #{deprecation_message}"
expect(log).to contains_log :warn, deprecation_message
end
end
end

describe "#perform" do
subject { auth_check.perform }

Expand Down

0 comments on commit a20a771

Please sign in to comment.