Permalink
Browse files

moved tests for TTL translation to the test_server file [#436]

  • Loading branch information...
1 parent 5f64897 commit 65ba8016384bd95a9306e488539bfb9244d4c947 @leonid-shevtsov leonid-shevtsov committed Feb 27, 2014
Showing with 12 additions and 15 deletions.
  1. +12 −0 test/test_server.rb
  2. +0 −15 test/test_ttl.rb
View
@@ -65,4 +65,16 @@
assert_equal 2, s.weight
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
View
@@ -1,15 +0,0 @@
-require 'helper'
-
-describe Dalli::Server do
- 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

0 comments on commit 65ba801

Please sign in to comment.