[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
This commit is contained in:
Nobuyoshi Nakada 2022-01-04 08:37:24 +09:00 коммит произвёл git
Родитель 8f9623741a
Коммит 0bfb406b75
1 изменённых файлов: 5 добавлений и 3 удалений

Просмотреть файл

@ -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