Blame SOURCES/rubygem-mulit_json-1.15.0-RSpec-3.11.0-distinguishes-between-hashed-and-Ruby-3.patch

572fc5
From 27732abae55d126ce28412b26e9c1b4358b8925a Mon Sep 17 00:00:00 2001
572fc5
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
572fc5
Date: Tue, 6 Sep 2022 09:57:31 +0200
572fc5
Subject: [PATCH] RSpec 3.11.0+ distinguishes between hashed and Ruby 3
572fc5
 keywords
572fc5
572fc5
This is due to change in RSpec [[1]], which cuases issues such as:
572fc5
572fc5
~~~
572fc5
  1) MultiJson default options sets both load and dump options
572fc5
     Failure/Error: self.load_options = self.dump_options = value
572fc5
572fc5
       MultiJson received :dump_options= with unexpected arguments
572fc5
         expected: ({:foo=>"bar"})
572fc5
              got: ({:foo=>"bar"})
572fc5
     # ./lib/multi_json.rb:15:in `default_options='
572fc5
     # ./spec/multi_json_spec.rb:171:in `block (4 levels) in <top (required)>'
572fc5
     # /builddir/build/BUILD/spec/spec_helper.rb:12:in `silence_warnings'
572fc5
     # ./spec/multi_json_spec.rb:171:in `block (3 levels) in <top (required)>'
572fc5
~~~
572fc5
572fc5
Fixes #203
572fc5
572fc5
[1]: https://github.com/rspec/rspec-mocks/pull/1394
572fc5
---
572fc5
 spec/multi_json_spec.rb            | 4 ++--
572fc5
 spec/shared/adapter.rb             | 8 ++++----
572fc5
 spec/shared/json_common_adapter.rb | 4 ++--
572fc5
 3 files changed, 8 insertions(+), 8 deletions(-)
572fc5
572fc5
diff --git a/spec/multi_json_spec.rb b/spec/multi_json_spec.rb
572fc5
index 323bff9..b3ffb4f 100644
572fc5
--- a/spec/multi_json_spec.rb
572fc5
+++ b/spec/multi_json_spec.rb
572fc5
@@ -166,8 +166,8 @@
572fc5
     end
572fc5
 
572fc5
     it 'sets both load and dump options' do
572fc5
-      expect(MultiJson).to receive(:dump_options=).with(:foo => 'bar')
572fc5
-      expect(MultiJson).to receive(:load_options=).with(:foo => 'bar')
572fc5
+      expect(MultiJson).to receive(:dump_options=).with({:foo => 'bar'})
572fc5
+      expect(MultiJson).to receive(:load_options=).with({:foo => 'bar'})
572fc5
       silence_warnings { MultiJson.default_options = {:foo => 'bar'} }
572fc5
     end
572fc5
   end
572fc5
diff --git a/spec/shared/adapter.rb b/spec/shared/adapter.rb
572fc5
index e850b99..52a6bc9 100644
572fc5
--- a/spec/shared/adapter.rb
572fc5
+++ b/spec/shared/adapter.rb
572fc5
@@ -19,7 +19,7 @@
572fc5
       before { MultiJson.dump_options = MultiJson.adapter.dump_options = {} }
572fc5
 
572fc5
       after do
572fc5
-        expect(MultiJson.adapter.instance).to receive(:dump).with(1, :foo => 'bar', :fizz => 'buzz')
572fc5
+        expect(MultiJson.adapter.instance).to receive(:dump).with(1, {:foo => 'bar', :fizz => 'buzz'})
572fc5
         MultiJson.dump(1, :fizz => 'buzz')
572fc5
         MultiJson.dump_options = MultiJson.adapter.dump_options = nil
572fc5
       end
572fc5
@@ -100,8 +100,8 @@
572fc5
     end
572fc5
 
572fc5
     it 'passes options to the adapter' do
572fc5
-      expect(MultiJson.adapter).to receive(:dump).with('foo', :bar => :baz)
572fc5
-      MultiJson.dump('foo', :bar => :baz)
572fc5
+      expect(MultiJson.adapter).to receive(:dump).with('foo', {:bar => :baz})
572fc5
+      MultiJson.dump('foo', {:bar => :baz})
572fc5
     end
572fc5
 
572fc5
     it 'dumps custom objects that implement to_json' do
572fc5
@@ -128,7 +128,7 @@ def to_json(*)
572fc5
       before { MultiJson.load_options = MultiJson.adapter.load_options = {} }
572fc5
 
572fc5
       after do
572fc5
-        expect(MultiJson.adapter.instance).to receive(:load).with('1', :foo => 'bar', :fizz => 'buzz')
572fc5
+        expect(MultiJson.adapter.instance).to receive(:load).with('1', {:foo => 'bar', :fizz => 'buzz'})
572fc5
         MultiJson.load('1', :fizz => 'buzz')
572fc5
         MultiJson.load_options = MultiJson.adapter.load_options = nil
572fc5
       end
572fc5
diff --git a/spec/shared/json_common_adapter.rb b/spec/shared/json_common_adapter.rb
572fc5
index 9597d90..5a23c38 100644
572fc5
--- a/spec/shared/json_common_adapter.rb
572fc5
+++ b/spec/shared/json_common_adapter.rb
572fc5
@@ -15,7 +15,7 @@
572fc5
     describe 'with :indent option' do
572fc5
       it 'passes it on dump' do
572fc5
         object = 'foo'
572fc5
-        expect(object).to receive(:to_json).with(:indent => "\t")
572fc5
+        expect(object).to receive(:to_json).with({:indent => "\t"})
572fc5
         MultiJson.dump(object, :indent => "\t")
572fc5
       end
572fc5
     end
572fc5
@@ -23,7 +23,7 @@
572fc5
 
572fc5
   describe '.load' do
572fc5
     it 'passes :quirks_mode option' do
572fc5
-      expect(::JSON).to receive(:parse).with('[123]', :quirks_mode => false, :create_additions => false)
572fc5
+      expect(::JSON).to receive(:parse).with('[123]', {:quirks_mode => false, :create_additions => false})
572fc5
       MultiJson.load('[123]', :quirks_mode => false)
572fc5
     end
572fc5
   end