1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
|
Description: Accept hash by using inspect, fixing tests under Ruby 3.4
Author: Simon Quigley <tsimonq2@debian.org>
Origin: vendor
Forwarded: not-needed
Last-Update: 2026-03-22
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/test/as_test.rb
+++ b/test/as_test.rb
@@ -36,8 +36,8 @@ class AsTest < Minitest::Spec
property :name, :as => lambda { |options| options[:user_options].inspect }
end
- it { render(song, user_options:{volume: 1}).must_equal_document({"{:volume=>1}" => "Revolution"}) }
- it { _(parse(song, {"{:volume=>1}" => "Wie Es Geht"}, user_options: {volume: 1}).name).must_equal "Wie Es Geht" }
+ it { render(song, user_options:{volume: 1}).must_equal_document({"#{{:volume=>1}.inspect}" => "Revolution"}) }
+ it { _(parse(song, {"#{{:volume=>1}.inspect}" => "Wie Es Geht"}, user_options: {volume: 1}).name).must_equal "Wie Es Geht" }
end
end
end
--- a/test/cached_test.rb
+++ b/test/cached_test.rb
@@ -65,7 +65,7 @@ class CachedTest < Minitest::Spec
# makes sure options are passed correctly.
_(representer.to_hash(user_options: {volume: 9})).must_equal({"name"=>"Live And Dangerous",
- "songs"=>[{"title"=>"Jailbreak:{:volume=>9}"}, {"title"=>"Southbound:{:volume=>9}"}, {"title"=>"Emerald:{:volume=>9}"}]}) # called in Deserializer/Serializer
+ "songs"=>[{"title"=>"Jailbreak:#{{:volume=>9}.inspect}"}, {"title"=>"Southbound:#{{:volume=>9}.inspect}"}, {"title"=>"Emerald:#{{:volume=>9}.inspect}"}]}) # called in Deserializer/Serializer
# representer becomes reusable as it is stateless.
# representer.update!(album2)
@@ -154,4 +154,4 @@ class CachedTest < Minitest::Spec
# printer.print(STDOUT)
end
end
-end
\ No newline at end of file
+end
--- a/test/definition_test.rb
+++ b/test/definition_test.rb
@@ -92,7 +92,7 @@ class DefinitionTest < Minitest::Spec
# #inspect
describe "#inspect" do
- it { _(Definition.new(:songs).inspect).must_equal "#<Representable::Definition ==>songs @options={:name=>\"songs\", :parse_filter=>[], :render_filter=>[]}>" }
+ it { _(Definition.new(:songs).inspect).must_equal "#<Representable::Definition ==>songs @options=#{{:name=>"songs", :parse_filter=>[], :render_filter=>[]}.inspect}>" }
end
--- a/test/filter_test.rb
+++ b/test/filter_test.rb
@@ -23,10 +23,10 @@ class FilterTest < Minitest::Spec
it {
song = OpenStruct.new.extend(representer).from_hash("title" => "VULCAN EARS", "track" => "Nine")
_(song.title).must_equal "VULCAN EARS"
- _(song.track).must_equal "nine,{\"title\"=>\"VULCAN EARS\", \"track\"=>\"Nine\"}"
+ _(song.track).must_equal "nine,#{{"title"=>"VULCAN EARS", "track"=>"Nine"}.inspect}"
}
- it { _(OpenStruct.new("title" => "vulcan ears", "track" => "Nine").extend(representer).to_hash).must_equal( {"title"=>"vulcan ears", "track"=>"NINE,{\"title\"=>\"vulcan ears\"},{}"}) }
+ it { _(OpenStruct.new("title" => "vulcan ears", "track" => "Nine").extend(representer).to_hash).must_equal( {"title"=>"vulcan ears", "track"=>"NINE,#{{"title"=>"vulcan ears"}.inspect},{}"}) }
describe "#parse_filter" do
@@ -54,4 +54,4 @@ end
# end
# it { OpenStruct.new("track" => "Nine").extend(representer).to_hash.must_equal({"track"=>"Nine-1-2"}) }
-# end
\ No newline at end of file
+# end
--- a/test/serialize_deserialize_test.rb
+++ b/test/serialize_deserialize_test.rb
@@ -13,7 +13,7 @@ class SerializeDeserializeTest < BaseTes
}
end
- it { _(subject.from_hash({"song" => Object}, user_options: {volume: 9}).song).must_equal "OBJECT Object {:volume=>9}" }
+ it { _(subject.from_hash({"song" => Object}, user_options: {volume: 9}).song).must_equal "OBJECT Object #{{:volume=>9}.inspect}" }
end
describe "serialize" do
@@ -28,6 +28,6 @@ class SerializeDeserializeTest < BaseTes
before { subject.song = "Arrested In Shanghai" }
- it { _(subject.to_hash(user_options: {volume: 9})).must_equal({"song"=>"Arrested In Shanghai {:volume=>9}"}) }
+ it { _(subject.to_hash(user_options: {volume: 9})).must_equal({"song"=>"Arrested In Shanghai #{{:volume=>9}.inspect}"}) }
end
-end
\ No newline at end of file
+end
|