airbrake-ruby 2.2.4 → 2.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 076ef6e377b4e2fbc3a5cce600393a13390da43c
4
- data.tar.gz: 8b31cc49491997971856b5c2d1480c00881f5058
3
+ metadata.gz: 2c6bcda11cc4df213ee240b89afd624859204780
4
+ data.tar.gz: 50f609e5e47c2129750b43f7f98bebf13794ef52
5
5
  SHA512:
6
- metadata.gz: b65105fb50ef5098b1bbfa489387e48f785fcdd8ba25dc7ac306c817385719b8fb9af684b11c447a98740dcc1a2cee17fc65376bc6934150f7f26e268c8ea88d
7
- data.tar.gz: 8ef30b2ef9aa0a652de4c9ef1a3a0a9f8b7d60018f9441bae0e7ebe16c79fe0a793290b666132b4adf447bfcdfc4ec9c6610459471f02d9ec0d1cd5b0cabc1ad
6
+ metadata.gz: daa0b464c5ca8818a006e0a10cec1ff185ffbf2b3602b0b57f1fda4b69032e17d3dbb512054b5a89a15ef0571d698526570c4a8c538c2d7ee1120b1b58158b9c
7
+ data.tar.gz: 845cd20d7caf62ab809db418cc38178e4dbf257e3436181250ffc14af851087be444315cd0af26830f0b3223e09df8d7a99aeaacc386d13b408766d62f621768
@@ -118,7 +118,7 @@ module Airbrake
118
118
 
119
119
  notice = build_notice(exception, params)
120
120
  @filter_chain.refine(notice)
121
- yield notice if block_given?
121
+ yield notice if block_given? && !notice.ignored?
122
122
 
123
123
  if notice.ignored?
124
124
  return promise.reject("#{notice} was marked as ignored")
@@ -4,5 +4,5 @@
4
4
  module Airbrake
5
5
  ##
6
6
  # @return [String] the library version
7
- AIRBRAKE_RUBY_VERSION = '2.2.4'.freeze
7
+ AIRBRAKE_RUBY_VERSION = '2.2.5'.freeze
8
8
  end
@@ -380,9 +380,29 @@ RSpec.describe Airbrake::Notifier do
380
380
  end
381
381
 
382
382
  describe "block argument" do
383
- it "yields a notice" do
384
- @airbrake.notify_sync(ex) { |notice| notice[:params][:bingo] = :bango }
385
- expect_a_request_with_body(/params":{.*"bingo":"bango".*}/)
383
+ context "when a notice is not ignored" do
384
+ it "yields the notice" do
385
+ @airbrake.notify_sync(ex) { |notice| notice[:params][:bingo] = :bango }
386
+ expect_a_request_with_body(/params":{.*"bingo":"bango".*}/)
387
+ end
388
+ end
389
+
390
+ context "when a notice is ignored before entering the block" do
391
+ it "doesn't call the given block" do
392
+ @airbrake.add_filter(&:ignore!)
393
+ @airbrake.notify_sync(ex) { |n| n[:params][:bingo] = :bango }
394
+ expect(
395
+ a_request(:post, endpoint).
396
+ with(body: /params":{.*"bingo":"bango".*}/)
397
+ ).not_to have_been_made
398
+ end
399
+ end
400
+
401
+ context "and when a notice is ignored inside the block" do
402
+ it "doesn't send the notice" do
403
+ @airbrake.notify_sync(ex, &:ignore!)
404
+ expect(a_request(:post, endpoint)).not_to have_been_made
405
+ end
386
406
  end
387
407
  end
388
408
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: airbrake-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.4
4
+ version: 2.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Airbrake Technologies, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-17 00:00:00.000000000 Z
11
+ date: 2017-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec