mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
[rubygems/rubygems] Update TarWriter
test to store mtime in a variable
0e2cec3fa3
This commit is contained in:
parent
819ecd115d
commit
a41eed99c0
1 changed files with 4 additions and 2 deletions
|
@ -52,11 +52,13 @@ class TestGemPackageTarWriter < Gem::Package::TarTestCase
|
|||
|
||||
def test_add_file_with_mtime
|
||||
Time.stub :now, Time.at(1_458_518_157) do
|
||||
@tar_writer.add_file "x", 0o644, Time.now do |f|
|
||||
mtime = Time.now
|
||||
|
||||
@tar_writer.add_file "x", 0o644, mtime do |f|
|
||||
f.write "a" * 10
|
||||
end
|
||||
|
||||
assert_headers_equal(tar_file_header("x", "", 0o644, 10, Time.now),
|
||||
assert_headers_equal(tar_file_header("x", "", 0o644, 10, mtime),
|
||||
@io.string[0, 512])
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue