HornsAndHooves-slackiq 1.1.10 → 1.1.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bafb038261d65a9e2a7e4023230f9d1faaa523191c549c4297a5ecf5d5334817
4
- data.tar.gz: 1e48a97b8096c22bc229c9c1a4d5ce9cffa88511ccaedca1cab8b3e0868a1461
3
+ metadata.gz: 166eaa1f83adf47643c88007ad176ab5a93ee3ed73a2218d62a613a773d91bf9
4
+ data.tar.gz: f409938354d0aca863f7cc8a8735829ac86f462af6c5aeeb8754d3511fd0fa76
5
5
  SHA512:
6
- metadata.gz: 3057b56ce554a061f4d4bc3bb3c2fdb1471a79ba04bd368dddeabefad84bda320a94f057d62957c4756fc9a146bfbfc87bae771f81f84147489fa50145cde5ec
7
- data.tar.gz: 2c103bb2002c78b35a53b5b56e7a5e96a00528205630dc34facd2d791dc0fa10cb6efbaa93a928277bc2ea83b742cc250361fa6f1c8c73eee22128ca5a004dff
6
+ metadata.gz: aad3af2dde472e6a0054d799a83511a622f3376ff92fe4ed21651ff5e9db79460e0aa6f2a8e21f7f746cb7396215daf2ef8b9d86f28f555a1b4a036cffb0aa4b
7
+ data.tar.gz: 2a2baf228601e3dc5efebcc6989d3127750b76663fe3b8556c4f06bfb503af0f9b5725d92537f4b33e4bafaa90cef7d4ae863fb2b628fb00b234752658827ebf
@@ -0,0 +1,22 @@
1
+ # RSpec::Sidekiq::Batch::Status does not support batch failures.
2
+ # Here, FailureStatus and SuccessStatus circumvent this problem.
3
+
4
+ if defined?(RSpec)
5
+ require 'rspec-sidekiq'
6
+
7
+ module RSpec
8
+ module Sidekiq
9
+ class FailureStatus < NullStatus
10
+ def failures
11
+ 1
12
+ end
13
+ end
14
+
15
+ class SuccessStatus < NullStatus
16
+ def failures
17
+ 0
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -1,3 +1,3 @@
1
1
  module Slackiq
2
- VERSION = "1.1.10"
2
+ VERSION = "1.1.11"
3
3
  end
data/lib/slackiq.rb CHANGED
@@ -5,6 +5,7 @@ require 'json'
5
5
  require 'httparty'
6
6
 
7
7
  require 'slackiq/time_helper'
8
+ require 'slackiq/sidekiq_status'
8
9
 
9
10
  require 'active_support' # For Hash#except
10
11
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: HornsAndHooves-slackiq
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.10
4
+ version: 1.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - HornsAndHooves
@@ -119,8 +119,8 @@ files:
119
119
  - Rakefile
120
120
  - bin/console
121
121
  - bin/setup
122
- - config/initializers/rspec-sidekiq.rb
123
122
  - lib/slackiq.rb
123
+ - lib/slackiq/sidekiq_status.rb
124
124
  - lib/slackiq/time_helper.rb
125
125
  - lib/slackiq/version.rb
126
126
  homepage: https://github.com/HornsAndHooves/slackiq
@@ -1,35 +0,0 @@
1
- # This patch is here because it is impossible to simulate failures with the rspec-sidekiq gem.
2
- # failures is a function that will always return 0:
3
- # https://github.com/philostler/rspec-sidekiq/blob/2cd15b0fe2b172243e8002c4aefa39696c42d52f/lib/rspec/sidekiq/batch.rb#L42
4
-
5
- require 'rspec/core'
6
-
7
- module Sidekiq
8
- class Batch
9
- class SuccessStatus; end
10
- class FailureStatus; end
11
- end
12
- end
13
-
14
- module RSpec
15
- module Sidekiq
16
- class FailureStatus < NullStatus
17
- def failures
18
- 1
19
- end
20
- end
21
-
22
- class SuccessStatus < NullStatus
23
- def failures
24
- 0
25
- end
26
- end
27
- end
28
- end
29
-
30
- RSpec.configure do |config|
31
- config.before(:each) do |example|
32
- allow(Sidekiq::Batch::SuccessStatus).to receive(:new) { RSpec::Sidekiq::SuccessStatus.new }
33
- allow(Sidekiq::Batch::FailureStatus).to receive(:new) { RSpec::Sidekiq::FailureStatus.new }
34
- end
35
- end