Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minitar TC_Tar__Input.test_each_works expected result should use Time.gm instead of Time.mktime (a.k.a. Time.local) #3

Closed
halostatue opened this issue Jul 30, 2011 · 0 comments · Fixed by #10
Assignees

Comments

@halostatue
Copy link
Owner

I am in the Pacific time zone, and the test data for Minitar 0.5.1 clearly were created using Eastern time zone times,
as the test below fails because the times are three hours off. So instead of using Time.mktime (a.k.a. Time.local)
to create the expected times, use Time.gm (a.k.a. Time.utc) to create them to match the values in the test data (or
change the test data so that it's easier to specify the argument to Time.gm).

>ruby install.rb
Checking for test cases:

Loaded suite Unnamed TestSuite
Started
.F...................
Finished in 0.969 seconds.

  1) Failure:
test_each_works(TC_Tar__Input)
    [./tests/tc_tar.rb:509:in `test_each_works'
     C:/Progra~1/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `e
ach_with_index'
     ./lib/archive/tar/minitar.rb:679:in `each'
     ./lib/archive/tar/minitar.rb:614:in `each_entry'
     ./lib/archive/tar/minitar.rb:605:in `each_entry'
     ./lib/archive/tar/minitar.rb:587:in `each'
     ./lib/archive/tar/minitar.rb:679:in `each'
     ./tests/tc_tar.rb:504:in `test_each_works'
     ./lib/archive/tar/minitar.rb:655:in `open'
     ./tests/tc_tar.rb:502:in `test_each_works']:
<1072944000> expected but was
<1072933200>.

21 tests, 348 assertions, 1 failures, 0 errors
halostatue added a commit that referenced this issue Dec 21, 2014
- Required changing the test data as well.
- Fixes #3.
@halostatue halostatue self-assigned this Dec 21, 2014
halostatue added a commit that referenced this issue Dec 21, 2014
-   Convert the project to Hoe.
-   Convert tests from test/unit to minitest.
    -   Enable travis-ci tests.
    -   Enable test coverage runs with coveralls.

-   Resolve #3 by using UTC time for a test and test data.
-   Resolve #2 by detecting seekable streams.

-   Deprecate `include Archive::Tar` with a warning.
-   Deprecate `include Archive::Tar::Minitar` with a warning.
-   Add an optional alias `::Minitar` for `Archive::Tar::Minitar`. A
    warning will be printed if `::Minitar` already exists.
-   Moved Archive::Tar::PosixHeader temporarily to
    Archive::Tar::Minitar::PosixHeader. A future release will make it
    ::Minitar::PosixHeader.
-   PosixHeader can now handle Time objects for `mtime` and does not
    require the integer version be provided.
-   Restructured Minitar::Writer.
-   Modified both `Writer#add_file_simple` and `Writer#add_file` to accept a
    `:data` field so that a block does not need to be provided.
halostatue added a commit that referenced this issue Dec 21, 2014
-   Convert the project to Hoe.
-   Convert tests from test/unit to minitest.
    -   Enable travis-ci tests.
    -   Enable test coverage runs with coveralls.

-   Resolve #3 by using UTC time for a test and test data.
-   Resolve #2 by detecting seekable streams.

-   Deprecate `include Archive::Tar` with a warning.
-   Deprecate `include Archive::Tar::Minitar` with a warning.
-   Add an optional alias `::Minitar` for `Archive::Tar::Minitar`. A
    warning will be printed if `::Minitar` already exists.
-   Moved Archive::Tar::PosixHeader temporarily to
    Archive::Tar::Minitar::PosixHeader. A future release will make it
    ::Minitar::PosixHeader.
-   PosixHeader can now handle Time objects for `mtime` and does not
    require the integer version be provided.
-   Restructured Minitar::Writer.
-   Modified both `Writer#add_file_simple` and `Writer#add_file` to accept a
    `:data` field so that a block does not need to be provided.
halostatue added a commit that referenced this issue Dec 21, 2014
-   Convert the project to Hoe.
-   Convert tests from test/unit to minitest.
    -   Enable travis-ci tests.
    -   Enable test coverage runs with coveralls.

-   Resolve #3 by using UTC time for a test and test data.
-   Resolve #2 by detecting seekable streams.

-   Deprecate `include Archive::Tar` with a warning.
-   Deprecate `include Archive::Tar::Minitar` with a warning.
-   Add an optional alias `::Minitar` for `Archive::Tar::Minitar`. A
    warning will be printed if `::Minitar` already exists.
-   Moved Archive::Tar::PosixHeader temporarily to
    Archive::Tar::Minitar::PosixHeader. A future release will make it
    ::Minitar::PosixHeader.
-   PosixHeader can now handle Time objects for `mtime` and does not
    require the integer version be provided.
-   Restructured Minitar::Writer.
-   Modified both `Writer#add_file_simple` and `Writer#add_file` to accept a
    `:data` field so that a block does not need to be provided.
halostatue added a commit that referenced this issue Dec 21, 2014
-   Convert the project to Hoe.
-   Convert tests from test/unit to minitest.
    -   Enable travis-ci tests.
    -   Enable test coverage runs with coveralls.

-   Resolve #3 by using UTC time for a test and test data.
-   Resolve #2 by detecting seekable streams.

-   Deprecate `include Archive::Tar` with a warning.
-   Deprecate `include Archive::Tar::Minitar` with a warning.
-   Add an optional alias `::Minitar` for `Archive::Tar::Minitar`. A
    warning will be printed if `::Minitar` already exists.
-   Moved Archive::Tar::PosixHeader temporarily to
    Archive::Tar::Minitar::PosixHeader. A future release will make it
    ::Minitar::PosixHeader.
-   PosixHeader can now handle Time objects for `mtime` and does not
    require the integer version be provided.
-   Restructured Minitar::Writer.
-   Modified both `Writer#add_file_simple` and `Writer#add_file` to accept a
    `:data` field so that a block does not need to be provided.
halostatue added a commit that referenced this issue Dec 21, 2014
-   Convert the project to Hoe.
-   Convert tests from test/unit to minitest.
    -   Enable travis-ci tests.
    -   Enable test coverage runs with coveralls.

-   Resolve #3 by using UTC time for a test and test data.
-   Resolve #2 by detecting seekable streams.

-   Deprecate `include Archive::Tar` with a warning.
-   Deprecate `include Archive::Tar::Minitar` with a warning.
-   Add an optional alias `::Minitar` for `Archive::Tar::Minitar`. A
    warning will be printed if `::Minitar` already exists.
-   Moved Archive::Tar::PosixHeader temporarily to
    Archive::Tar::Minitar::PosixHeader. A future release will make it
    ::Minitar::PosixHeader.
-   PosixHeader can now handle Time objects for `mtime` and does not
    require the integer version be provided.
-   Restructured Minitar::Writer.
-   Modified both `Writer#add_file_simple` and `Writer#add_file` to accept a
    `:data` field so that a block does not need to be provided.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant