Permalink
Browse files

Fix TOUCH command test.

  • Loading branch information...
1 parent bc21672 commit 5c99266a5d41c4f7c8c95dcfc046a2dcaa0526cc @dfens dfens committed Aug 7, 2012
Showing with 11 additions and 6 deletions.
  1. +11 −6 test/test_dalli.rb
View
@@ -296,12 +296,17 @@
should 'support touch operation' do
memcached do |dc|
- resp = dc.flush
- dc.set 'key', 'value'
- assert_equal true, dc.touch('key', 10)
- assert_equal true, dc.touch('key')
- assert_equal 'value', dc.get('key')
- assert_nil dc.touch('notexist')
+ begin
+ resp = dc.flush
+ dc.set 'key', 'value'
+ assert_equal true, dc.touch('key', 10)
+ assert_equal true, dc.touch('key')
+ assert_equal 'value', dc.get('key')
+ assert_nil dc.touch('notexist')
+ rescue Dalli::DalliError => e
+ # This will happen when memcached is in lesser version than 1.4.8
+ assert_equal 'Response error 129: Unknown command', e.message
+ end
end
end

0 comments on commit 5c99266

Please sign in to comment.