Skip to content

Commit

Permalink
moved tests for TTL translation to the test_server file [#436]
Browse files Browse the repository at this point in the history
  • Loading branch information
leonid-shevtsov committed Feb 27, 2014
1 parent 5f64897 commit 65ba801
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
12 changes: 12 additions & 0 deletions test/test_server.rb
Expand Up @@ -65,4 +65,16 @@
assert_equal 2, s.weight assert_equal 2, s.weight
end end
end end

describe 'ttl translation' do
it 'does not translate ttls under 30 days' do
s = Dalli::Server.new('localhost')
assert_equal s.send(:sanitize_ttl, 30*24*60*60), 30*24*60*60
end

it 'translates ttls over 30 days into timestamps' do
s = Dalli::Server.new('localhost')
assert_equal s.send(:sanitize_ttl, 30*24*60*60 + 1), Time.now.to_i + 30*24*60*60+1
end
end
end end
15 changes: 0 additions & 15 deletions test/test_ttl.rb

This file was deleted.

0 comments on commit 65ba801

Please sign in to comment.