Skip to content

Commit

Permalink
Make tests pass again. Time.local returns local time.
Browse files Browse the repository at this point in the history
git-svn-id: http://rubygems.rubyforge.org/svn/trunk@1445 3d4018f9-ac1a-0410-99e9-8a154d859a19
  • Loading branch information
drbrain committed Oct 9, 2007
1 parent 8e1f6bc commit 12b7f04
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/rubygems/specification.rb
Expand Up @@ -13,7 +13,7 @@
# Time::today has been deprecated in 0.9.5 and will be removed.
def Time.today
t = Time.now
t - (t.to_i % 86400)
t - (t.to_i % 86400) - t.gmt_offset - 86400
end
# :startdoc:

Expand Down Expand Up @@ -68,7 +68,7 @@ class Specification
MARSHAL_FIELDS = { -1 => 16, 1 => 16, 2 => 16 }

now = Time.now
TODAY = now - (now.to_i % 86400)
TODAY = Time.at((now - (now.to_i % 86400) - now.gmt_offset - 86400).to_i)
# :startdoc:

# ------------------------- Class variables.
Expand Down
5 changes: 3 additions & 2 deletions test/test_gem_config_file.rb
Expand Up @@ -26,7 +26,7 @@ def test_initialize
assert_equal false, @cfg.backtrace
assert_equal true, @cfg.update_sources
assert_equal false, @cfg.benchmark
assert_equal 500, @cfg.bulk_threshold
assert_equal Gem::ConfigFile::DEFAULT_BULK_THRESHOLD, @cfg.bulk_threshold
assert_equal true, @cfg.verbose
assert_equal %w[http://gems.example.com], Gem.sources

Expand Down Expand Up @@ -153,7 +153,8 @@ def test_write
# These should not be written out to the config file.
assert_equal false, @cfg.backtrace, 'backtrace'
assert_equal false, @cfg.benchmark, 'benchmark'
assert_equal 500, @cfg.bulk_threshold, 'bulk_threshold'
assert_equal Gem::ConfigFile::DEFAULT_BULK_THRESHOLD, @cfg.bulk_threshold,
'bulk_threshold'
assert_equal true, @cfg.update_sources, 'update_sources'
assert_equal true, @cfg.verbose, 'verbose'

Expand Down

0 comments on commit 12b7f04

Please sign in to comment.