Skip to content

Remove Time.now from test for comparison of timestamp #679

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

Merged
merged 1 commit into from
Dec 8, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions test/test_rdoc_generator_json_index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ def test_file_dir
end

def test_generate
now = Time.now
@g.generate

assert_file 'js/searcher.js'
Expand All @@ -109,15 +108,6 @@ def test_generate
assert orig_file.mtime.inspect == generated_file.mtime.inspect,
'.js files should be tha same timestamp of original'

assert generated_file.mtime < now,
".js files should be the same timestamp,\n" +
"path: #{generated_file.inspect},\n" +
"time: #{generated_file.mtime.inspect},\n" +
"now : #{now.inspect}"

generated_search_index = Pathname(File.join @tmpdir, 'js/search_index.js')
assert generated_search_index.mtime > (now - 1), 'search_index.js should be generated timestamp'

json = File.read 'js/search_index.js'

json =~ /\Avar search_data = /
Expand Down