rspec-sidekiq 4.0.0.pre → 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: 3320d82a82c0cbb318c7d563be5a7d4482178b8e4d4b6936e710bc88d8ce7531
4
- data.tar.gz: d34d50e7d90f8e5ece3aceca122f89b51f77afb10c7c76ee19496a562151ff42
3
+ metadata.gz: e10d7ad26e39e70dba0ed0054c32d5edfdefd4788a06ca858c09d6a4aa90cd65
4
+ data.tar.gz: 050a61d6dd8720285462ff0ca3fe9d626a0f45f668f72d99d7f57d4788c77b29
5
5
  SHA512:
6
- metadata.gz: b3c1a1b22cd93d5d18729365df70fcb3b8d98f5c83b5f6d2cde618eb03a425ee5164a66abf92b139c62629ab95a55b35a89a06e202699effd6e472654281d59a
7
- data.tar.gz: 5c6a68c4890e8de3de64e52b7d3c6cc603c743f8980e7e7d6cebbd4ff819e7d183a617c3677bd9a924eba405c655d8e35c8a52f3e02f259a081806e5d810dfbf
6
+ metadata.gz: b7575bbe2397006c254cb61bce816460efc01dc7fb4434e371e3234796e4dbb12ab9e0bd9d9e769971979b060fb62852d2d54cdc1786b823f4a835467ebfcf6b
7
+ data.tar.gz: b2c3200a2f0dc3afd7b779564649e7c2a29b0d65a70c86d029704501ff4c9dc4180595a9520133a4568c3a956f4df713f5f382f2dd5e10f42c2095bd2b0208e6
data/CHANGES.md CHANGED
@@ -1,4 +1,9 @@
1
- Unreleased - 4.0.0
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
+
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)`.
4
9
  * [BREAKING] Dropped support for Ruby 2.6
@@ -10,6 +15,7 @@ Unreleased - 4.0.0
10
15
  * Add support for builtin argument matchers from rspec mocks for
11
16
  `have_enqueued_sidekiq_job` (#200)
12
17
  * Add `#on` to `have_enqueued_sidekiq_job` to support testing queue at enqueue time (#197)
18
+ * Add `enqueue_sidekiq_job` for block-syntax style expectations
13
19
  * Clarified `have_enqueued_sidekiq_job` error message to make it clear that the "actual arguments" list is an array of argument-lists across all enqueued jobs. (#195)
14
20
  * Fix `in` and `at` evaluation to match Sidekiq (#194)
15
21
  * Fix `be_delayed` argument matcher (#196)
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.pre"
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.pre
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-09 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
@@ -269,9 +269,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
269
269
  version: '0'
270
270
  required_rubygems_version: !ruby/object:Gem::Requirement
271
271
  requirements:
272
- - - ">"
272
+ - - ">="
273
273
  - !ruby/object:Gem::Version
274
- version: 1.3.1
274
+ version: '0'
275
275
  requirements: []
276
276
  rubygems_version: 3.3.26
277
277
  signing_key: