rspec-sidekiq 4.0.0 → 4.0.1

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: fb94abca8e805aa88d9c84deb0ddb22746542845b48cde790c4da9ae58f48ca0
4
- data.tar.gz: 646f1ee2cc023cd988f29b50250c6794cb7563a78c35a397f1f3290cbf9df97b
3
+ metadata.gz: e10d7ad26e39e70dba0ed0054c32d5edfdefd4788a06ca858c09d6a4aa90cd65
4
+ data.tar.gz: 050a61d6dd8720285462ff0ca3fe9d626a0f45f668f72d99d7f57d4788c77b29
5
5
  SHA512:
6
- metadata.gz: 0d0b4a026d3e28f55e03076023b83eb11334cd2759514837f0fd37ce74d01279bf0aa53236e84185eb89e949ad429f21c40e09d1858c5a0beb622f5001617311
7
- data.tar.gz: 42c83b796648b68262a689f6fabe441719347e9464505ca4ade74ebab9cad748e51896af223b441adda74fe9b6300cb9ecb1f1974843fa45cf225dcbefc996ca
6
+ metadata.gz: b7575bbe2397006c254cb61bce816460efc01dc7fb4434e371e3234796e4dbb12ab9e0bd9d9e769971979b060fb62852d2d54cdc1786b823f4a835467ebfcf6b
7
+ data.tar.gz: b2c3200a2f0dc3afd7b779564649e7c2a29b0d65a70c86d029704501ff4c9dc4180595a9520133a4568c3a956f4df713f5f382f2dd5e10f42c2095bd2b0208e6
data/CHANGES.md CHANGED
@@ -1,3 +1,8 @@
1
+ 4.0.1
2
+ ---
3
+ * Restore the old normalizing expected args behavior with symbols (#205)
4
+ * fixes an unintentional breaking change in 4.0.0
5
+
1
6
  4.0.0
2
7
  ---
3
8
  * [BREAKING] Dropped support for matching jobs on ActiveJob's private API args, (e.g. `_aj_globalid` and `_aj_ruby2_keywords`). `_aj_globalid` can be replaced with the object itself, e.g. `have_enqueued_sidekiq_job(user)`.
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  **Welcome @wspurgin as new maintainer for `rspec-sidekiq`!**
2
2
 
3
- [![RubyGems][gem_version_badge]][ruby_gems]
3
+ [![Gem Version](https://badge.fury.io/rb/rspec-sidekiq.svg)](https://badge.fury.io/rb/rspec-sidekiq)
4
4
  [![Github Actions CI][github_actions_badge]][github_actions]
5
5
 
6
6
  Simple testing of Sidekiq jobs via a collection of matchers and helpers.
@@ -341,11 +341,7 @@ Please do! If there's a feature missing that you'd love to see then get in on th
341
341
 
342
342
  Issues/Pull Requests/Comments all welcome...
343
343
 
344
- [gem_version_badge]: https://badge.fury.io/rb/rspec-sidekiq.svg
345
344
  [github]: http://github.com/wspurgin/rspec-sidekiq
346
- [ruby_doc]: http://rubydoc.info/gems/rspec-sidekiq/frames
347
- [ruby_gems]: http://rubygems.org/gems/rspec-sidekiq
348
- [ruby_toolbox]: http://www.ruby-toolbox.com/projects/rspec-sidekiq
349
345
  [github_actions]: https://github.com/wspurgin/rspec-sidekiq/actions
350
346
  [github_actions_badge]: https://github.com/wspurgin/rspec-sidekiq/actions/workflows/main.yml/badge.svg
351
347
 
@@ -171,7 +171,7 @@ module RSpec
171
171
  end
172
172
 
173
173
  def with(*expected_arguments)
174
- @expected_arguments = expected_arguments
174
+ @expected_arguments = normalize_arguments(expected_arguments)
175
175
  self
176
176
  end
177
177
 
@@ -237,18 +237,17 @@ module RSpec
237
237
  RSpec::Support::ObjectFormatter.format(thing)
238
238
  end
239
239
 
240
- def jsonified_expected_arguments
241
- # We would just cast-to-parse-json, but we need to support
242
- # RSpec matcher args like #kind_of
243
- @jsonified_expected_arguments ||= begin
244
- expected_arguments.map do |arg|
245
- case arg.class
246
- when Symbol then arg.to_s
247
- when Hash then JSON.parse(arg.to_json)
248
- else
249
- arg
250
- end
240
+ def normalize_arguments(args)
241
+ if args.is_a?(Array)
242
+ args.map{ |x| normalize_arguments(x) }
243
+ elsif args.is_a?(Hash)
244
+ args.each_with_object({}) do |(key, value), hash|
245
+ hash[key.to_s] = normalize_arguments(value)
251
246
  end
247
+ elsif args.is_a?(Symbol)
248
+ args.to_s
249
+ else
250
+ args
252
251
  end
253
252
  end
254
253
  end
@@ -9,7 +9,7 @@ module RSpec
9
9
  class HaveEnqueuedSidekiqJob < Base
10
10
  def initialize(expected_arguments)
11
11
  super()
12
- @expected_arguments = expected_arguments
12
+ @expected_arguments = normalize_arguments(expected_arguments)
13
13
  end
14
14
 
15
15
  def matches?(job_class)
@@ -17,7 +17,7 @@ module RSpec
17
17
 
18
18
  @actual_jobs = EnqueuedJobs.new(klass)
19
19
 
20
- actual_jobs.includes?(jsonified_expected_arguments, expected_options)
20
+ actual_jobs.includes?(expected_arguments, expected_options)
21
21
  end
22
22
  end
23
23
  end
@@ -1,5 +1,5 @@
1
1
  module RSpec
2
2
  module Sidekiq
3
- VERSION = "4.0.0"
3
+ VERSION = "4.0.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-sidekiq
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aidan Coyle
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2023-08-15 00:00:00.000000000 Z
13
+ date: 2023-08-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec-core