New Upstream Snapshot - ruby-protocol-http
Ready changes
Summary
Merged new upstream version: 0.23.12+git20220927.1.5f9c3d4 (was: 0.23.12).
Resulting package
Built on 2022-09-28T17:14 (took 6m9s)
The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:
apt install -t fresh-snapshots ruby-protocol-http
Lintian Result
Diff
diff --git a/.gitignore b/.gitignore
index edf366b..21231aa 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,6 +5,7 @@
/doc/
/pkg/
/spec/reports/
+/spec/protocol/http/body/reader_spec.txt
/tmp/
/external/
diff --git a/debian/changelog b/debian/changelog
index 01140bc..5115fc2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+ruby-protocol-http (0.23.12+git20220927.1.5f9c3d4-1) UNRELEASED; urgency=low
+
+ * New upstream snapshot.
+
+ -- Debian Janitor <janitor@jelmer.uk> Wed, 28 Sep 2022 17:10:16 -0000
+
ruby-protocol-http (0.23.12-1) unstable; urgency=medium
* New upstream release
diff --git a/lib/protocol/http/body/reader.rb b/lib/protocol/http/body/reader.rb
index a289791..7527650 100644
--- a/lib/protocol/http/body/reader.rb
+++ b/lib/protocol/http/body/reader.rb
@@ -57,9 +57,9 @@ module Protocol
end
# Write the body of the response to the given file path.
- def save(path, mode = ::File::WRONLY|::File::CREAT, *args)
+ def save(path, mode = ::File::WRONLY|::File::CREAT, **options)
if @body
- ::File.open(path, mode, *args) do |file|
+ ::File.open(path, mode, **options) do |file|
self.each do |chunk|
file.write(chunk)
end
diff --git a/spec/protocol/http/body/reader_spec.rb b/spec/protocol/http/body/reader_spec.rb
new file mode 100644
index 0000000..68c104b
--- /dev/null
+++ b/spec/protocol/http/body/reader_spec.rb
@@ -0,0 +1,37 @@
+require 'protocol/http/body/reader'
+
+RSpec.describe Protocol::HTTP::Body::Reader do
+ class TestReader
+ include Protocol::HTTP::Body::Reader
+
+ def initialize(body)
+ @body = body
+ end
+ end
+
+ subject do
+ TestReader.new(%w(the quick brown fox))
+ end
+
+ describe '#save' do
+ let(:path) { File.expand_path('reader_spec.txt', __dir__) }
+
+ before do
+ File.open(path, 'w') {}
+ end
+
+ it 'saves to the provided filename' do
+ expect { subject.save(path) }
+ .to change { File.read(path) }
+ .from('')
+ .to('thequickbrownfox')
+ end
+
+ it 'mirrors the interface of File.open' do
+ expect { subject.save(path, nil, mode: 'w') }
+ .to change { File.read(path) }
+ .from('')
+ .to('thequickbrownfox')
+ end
+ end
+end
Debdiff
File lists identical (after any substitutions)
No differences were encountered in the control files