test/wolverine/script_test.rb in wolverine-0.2.7 vs test/wolverine/script_test.rb in wolverine-0.3.0

- old
+ new

@@ -41,22 +41,23 @@ tc.assert_operator b, :<, 1 tc.assert_equal :evalsha, c } Wolverine.config.instrumentation = callback redis = Class.new do - define_method(:evalsha) do |digest, *args| + define_method(:evalsha) do |digest, size, *args| nil end end script.call(redis.new, :a, :b) end def test_call_with_cache_hit tc = self redis = Class.new do - define_method(:evalsha) do |digest, *args| + define_method(:evalsha) do |digest, size, *args| tc.assert_equal DIGEST, digest + tc.assert_equal 2, size tc.assert_equal [:a, :b], args end end script.call(redis.new, :a, :b) end @@ -65,11 +66,12 @@ tc = self redis = Class.new do define_method(:evalsha) do |*| raise "NOSCRIPT No matching script. Please use EVAL." end - define_method(:eval) do |content, *args| + define_method(:eval) do |content, size, *args| tc.assert_equal CONTENT, content + tc.assert_equal 2, size tc.assert_equal [:a, :b], args end end script.call(redis.new, :a, :b) end