Skip to content

Commit 34a1551

Browse files
committed
Rspec-mocks recieve.with become more sensitive to hash vs keyword arguments for Ruby > 3.
1 parent f3da7dd commit 34a1551

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

lib/rdf/spec/reader.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
format_class.file_extensions.each_pair do |sym, content_type|
3131
reader_mock = double("reader")
3232
expect(reader_mock).to receive(:got_here)
33-
expect(RDF::Reader).to receive(:for).with(file_name: "foo.#{sym}").and_return(reader_class)
33+
expect(RDF::Reader).to receive(:for).with({file_name: "foo.#{sym}"}).and_return(reader_class)
3434
RDF::Reader.open("foo.#{sym}") do |r|
3535
expect(r).to be_a(reader_class)
3636
reader_mock.got_here
@@ -55,7 +55,7 @@
5555
format_class.file_extensions.each_pair do |sym, content_type|
5656
reader_mock = double("reader")
5757
expect(reader_mock).to receive(:got_here)
58-
expect(RDF::Reader).to receive(:for).with(file_name: "foo.#{sym}").and_return(reader_class)
58+
expect(RDF::Reader).to receive(:for).with({file_name: "foo.#{sym}"}).and_return(reader_class)
5959
RDF::Reader.open("foo.#{sym}", file_name: "foo.#{sym}") do |r|
6060
expect(r).to be_a(reader_class)
6161
reader_mock.got_here
@@ -68,7 +68,7 @@
6868
format_class.content_types.each_pair do |content_type, formats|
6969
reader_mock = double("reader")
7070
expect(reader_mock).to receive(:got_here)
71-
expect(RDF::Reader).to receive(:for).with(content_type: content_type, file_name: "foo").and_return(reader_class)
71+
expect(RDF::Reader).to receive(:for).with({content_type: content_type, file_name: "foo"}).and_return(reader_class)
7272
RDF::Reader.open("foo", content_type: content_type) do |r|
7373
expect(r).to be_a(reader_class)
7474
reader_mock.got_here

lib/rdf/spec/writer.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
format_class.file_extensions.each_pair do |sym, content_type|
9595
writer_mock = double("writer")
9696
expect(writer_mock).to receive(:got_here)
97-
expect(writer_class).to receive(:for).with(file_name: "#{@rdf_writer_iv_basename}.#{sym}").and_return(writer_class)
97+
expect(writer_class).to receive(:for).with({file_name: "#{@rdf_writer_iv_basename}.#{sym}"}).and_return(writer_class)
9898
writer_class.open("#{@rdf_writer_iv_basename}.#{sym}") do |r|
9999
expect(r).to be_a(RDF::Writer)
100100
writer_mock.got_here
@@ -117,7 +117,7 @@
117117
format_class.file_extensions.each_pair do |sym, content_type|
118118
writer_mock = double("writer")
119119
expect(writer_mock).to receive(:got_here)
120-
expect(writer_class).to receive(:for).with(file_name: "#{@rdf_writer_iv_basename}.#{sym}").and_return(writer_class)
120+
expect(writer_class).to receive(:for).with({file_name: "#{@rdf_writer_iv_basename}.#{sym}"}).and_return(writer_class)
121121
writer_class.open("#{@rdf_writer_iv_basename}.#{sym}", file_name: "#{@rdf_writer_iv_basename}.#{sym}") do |r|
122122
expect(r).to be_a(RDF::Writer)
123123
writer_mock.got_here
@@ -129,7 +129,7 @@
129129
format_class.content_types.each_pair do |content_type, formats|
130130
writer_mock = double("writer")
131131
expect(writer_mock).to receive(:got_here)
132-
expect(writer_class).to receive(:for).with(content_type: content_type, file_name: @rdf_writer_iv_basename).and_return(writer_class)
132+
expect(writer_class).to receive(:for).with({content_type: content_type, file_name: @rdf_writer_iv_basename}).and_return(writer_class)
133133
writer_class.open(@rdf_writer_iv_basename, content_type: content_type) do |r|
134134
expect(r).to be_a(RDF::Writer)
135135
writer_mock.got_here

0 commit comments

Comments
 (0)