From 46e421bedffacd5429cc14e7e3bce99ea8cd8562 Mon Sep 17 00:00:00 2001 From: softwaregravy <426690+softwaregravy@users.noreply.github.com> Date: Sun, 26 Jan 2025 13:44:32 -0500 Subject: [PATCH 1/2] - fix: update charset assertion to use correct casing in httpx_test.rb Partial fix for #93 This may not be the 'correct' fix, but it will not break any current users and is safe for immediate release --- test/httpx_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/httpx_test.rb b/test/httpx_test.rb index 9c17105..3049ba1 100644 --- a/test/httpx_test.rb +++ b/test/httpx_test.rb @@ -152,7 +152,7 @@ it "adds #charset extracted from Content-Type" do tempfile = Down::Httpx.download("#{$httpbin}/html") assert_equal "text/html", tempfile.content_type - assert_equal "utf-8", tempfile.charset + assert_equal "UTF-8", tempfile.charset.name end it "accepts download destination" do @@ -303,4 +303,4 @@ assert_raises(HTTPX::Error) { Down::Httpx.open("http://32r3ida") } end end -end \ No newline at end of file +end From b9619e022742268b416991dfb75e49df5dc92347 Mon Sep 17 00:00:00 2001 From: softwaregravy <426690+softwaregravy@users.noreply.github.com> Date: Sun, 26 Jan 2025 17:43:03 -0500 Subject: [PATCH 2/2] - fix: update encoding representation in ChunkedIO inspect method to BINARY (ASCII-8BIT) --- test/chunked_io_test.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/chunked_io_test.rb b/test/chunked_io_test.rb index 028acbe..9d574f6 100644 --- a/test/chunked_io_test.rb +++ b/test/chunked_io_test.rb @@ -829,19 +829,19 @@ def chunked_io(**options) describe "#inspect" do it "shows important information" do - assert_equal "# size=nil encoding=# data={} on_close=nil rewindable=true>", + assert_equal "# size=nil encoding=# data={} on_close=nil rewindable=true>", chunked_io(chunks: [""].each).inspect - assert_equal "# size=10 encoding=# data={} on_close=nil rewindable=true>", + assert_equal "# size=10 encoding=# data={} on_close=nil rewindable=true>", chunked_io(chunks: [""].each, size: 10).inspect assert_equal "# size=nil encoding=# data={} on_close=nil rewindable=true>", chunked_io(chunks: [""].each, encoding: "utf-8").inspect - assert_equal "# size=nil encoding=# data={:foo=>\"bar\"} on_close=nil rewindable=true>", + assert_equal "# size=nil encoding=# data={foo: \"bar\"} on_close=nil rewindable=true>", chunked_io(chunks: [""].each, data: {foo: "bar"}).inspect - assert_equal "# size=nil encoding=# data={} on_close=:callable rewindable=true>", + assert_equal "# size=nil encoding=# data={} on_close=:callable rewindable=true>", chunked_io(chunks: [""].each, on_close: :callable).inspect - assert_equal "# size=nil encoding=# data={} on_close=nil rewindable=false>", + assert_equal "# size=nil encoding=# data={} on_close=nil rewindable=false>", chunked_io(chunks: [""].each, rewindable: false).inspect - assert_equal "# size=nil encoding=# data={} on_close=nil rewindable=true (closed)>", + assert_equal "# size=nil encoding=# data={} on_close=nil rewindable=true (closed)>", chunked_io(chunks: [""].each).tap(&:close).inspect end end