Skip to content

Commit

Permalink
Remove deprecated Appsignal.is_ignored_(error|action)?
Browse files Browse the repository at this point in the history
As deprecated in #224.
Part of #202.
  • Loading branch information
jeffkreeftmeijer committed Nov 26, 2020
1 parent cd73776 commit f646175
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 79 deletions.
15 changes: 0 additions & 15 deletions lib/appsignal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -279,21 +279,6 @@ def active?
config && config.active? && extension_loaded?
end

# @deprecated No replacement
def is_ignored_error?(error) # rubocop:disable Naming/PredicateName
deprecation_message "Appsignal.is_ignored_error? is deprecated " \
"with no replacement and will be removed in version 3.0."
Appsignal.config[:ignore_errors].include?(error.class.name)
end
alias :is_ignored_exception? :is_ignored_error?

# @deprecated No replacement
def is_ignored_action?(action) # rubocop:disable Naming/PredicateName
deprecation_message "Appsignal.is_ignored_action? is deprecated " \
"with no replacement and will be removed in version 3.0."
Appsignal.config[:ignore_actions].include?(action)
end

private

def start_stdout_logger
Expand Down
64 changes: 0 additions & 64 deletions spec/lib/appsignal_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -950,70 +950,6 @@
end
end
end

describe ".is_ignored_error?" do
let(:error) { StandardError.new }
let(:err_stream) { std_stream }
let(:stderr) { err_stream.read }
before do
allow(Appsignal).to receive(:config).and_return(:ignore_errors => ["StandardError"])
end

subject do
capture_std_streams(std_stream, err_stream) do
Appsignal.is_ignored_error?(error)
end
end

it "should return true if it's in the ignored list" do
is_expected.to be_truthy
end

it "outputs deprecated warning" do
subject
expect(stderr).to include("Appsignal.is_ignored_error? is deprecated with no replacement")
end

context "when error is not in the ignored list" do
let(:error) { Object.new }

it "should return false" do
is_expected.to be_falsy
end
end
end

describe ".is_ignored_action?" do
let(:action) { "TestController#isup" }
let(:err_stream) { std_stream }
let(:stderr) { err_stream.read }
before do
allow(Appsignal).to receive(:config).and_return(:ignore_actions => "TestController#isup")
end

subject do
capture_std_streams(std_stream, err_stream) do
Appsignal.is_ignored_action?(action)
end
end

it "should return true if it's in the ignored list" do
is_expected.to be_truthy
end

it "outputs deprecated warning" do
subject
expect(stderr).to include("Appsignal.is_ignored_action? is deprecated with no replacement")
end

context "when action is not in the ingore list" do
let(:action) { "TestController#other_action" }

it "should return false" do
is_expected.to be_falsy
end
end
end
end

describe ".start_logger" do
Expand Down

0 comments on commit f646175

Please sign in to comment.