Sha256: 533284bb81a8b300738656147491fb4ab5d7bd16233546d5ac1642b22e98aa5f
Contents?: true
Size: 1.24 KB
Versions: 10
Compression:
Stored size: 1.24 KB
Contents
require File.expand_path("#{File.dirname(__FILE__)}/../helper") require "redis" class RorVsWild::Plugin::RedisTest < Minitest::Test include RorVsWildAgentHelper def test_callback url = "redis://localhost:6379/1" agent.measure_code("::Redis.new(url: '#{url}').get('foo')") assert_equal(1, agent.data[:sections].size) assert_equal("redis", agent.data[:sections][0].kind) assert_equal("select 1\nget foo", agent.data[:sections][0].command) end def test_callback_when_pipelined agent.measure_block("pipeline") do (redis = ::Redis.new).pipelined do redis.get("foo") redis.set("foo", "bar") end end assert_equal(1, agent.data[:sections].size) assert_equal("redis", agent.data[:sections][0].kind) assert_equal("get foo\nset foo bar", agent.data[:sections][0].command) end def test_commands_to_string_hide_auth_password assert_equal("auth *****", RorVsWild::Plugin::Redis.commands_to_string([[:auth, "SECRET"]])) end def test_appendable_commands? assert(RorVsWild::Plugin::Redis.appendable_commands?([[:select, 1]])) assert(RorVsWild::Plugin::Redis.appendable_commands?([[:auth, "SECRET"]])) refute(RorVsWild::Plugin::Redis.appendable_commands?([[:get, "KEY"]])) end end
Version data entries
10 entries across 10 versions & 1 rubygems