Skip to content

Commit

Permalink
Fix the test to use the mock gem path
Browse files Browse the repository at this point in the history
"NUL.*" means the NUL device on Windows, as well as mere "NUL",
and no data is read.
  • Loading branch information
nobu committed Jan 4, 2022
1 parent 48ea277 commit e2c7d22
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions bundler/spec/bundler/gem_helper_spec.rb
Expand Up @@ -170,9 +170,11 @@ def mock_checksum_message(name, version)

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
Expand Down

0 comments on commit e2c7d22

Please sign in to comment.