summaryrefslogtreecommitdiff
path: root/spec/bundler/bundler
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2022-01-04 08:37:24 +0900
committergit <svn-admin@ruby-lang.org>2022-01-04 14:59:17 +0900
commit0bfb406b7577e733873f59a108795b59fab3c264 (patch)
treecf15101da70c0c864e5e03fafcb56d6d7281760b /spec/bundler/bundler
parent8f9623741a2cfe8d26af44c3a4f13dffc88fe834 (diff)
[rubygems/rubygems] Fix the test to use the mock gem path
"NUL.*" means the NUL device on Windows, as well as mere "NUL", and no data is read. https://github.com/rubygems/rubygems/commit/e2c7d22745
Diffstat (limited to 'spec/bundler/bundler')
-rw-r--r--spec/bundler/bundler/gem_helper_spec.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/spec/bundler/bundler/gem_helper_spec.rb b/spec/bundler/bundler/gem_helper_spec.rb
index 59feb5b8e9..2a6a631074 100644
--- a/spec/bundler/bundler/gem_helper_spec.rb
+++ b/spec/bundler/bundler/gem_helper_spec.rb
@@ -170,9 +170,11 @@ RSpec.describe Bundler::GemHelper do
describe "#build_checksum" do
it "calculates SHA512 of the content" do
- subject.build_checksum(Pathname(IO::NULL))
- sha_path = app_path.join("checksums", "#{File.basename(IO::NULL)}.sha512")
- expect(File.read(sha_path).chomp).to eql(Digest::SHA512.hexdigest(""))
+ FileUtils.mkdir_p(app_gem_dir)
+ File.write(app_gem_path, "")
+ mock_checksum_message app_name, app_version
+ subject.build_checksum(app_gem_path)
+ expect(File.read(app_sha_path).chomp).to eql(Digest::SHA512.hexdigest(""))
end
context "when build was successful" do