diff --git a/lib/suo/client/base.rb b/lib/suo/client/base.rb index 289f3d9..533dcec 100644 --- a/lib/suo/client/base.rb +++ b/lib/suo/client/base.rb @@ -49,7 +49,7 @@ module Suo val, cas = get(key) if val.nil? - set_initial(key) + initial_set(key) next end @@ -94,7 +94,7 @@ module Suo val, cas = get(key) if val.nil? - set_initial(key) + initial_set(key) next end @@ -123,7 +123,7 @@ module Suo fail NotImplementedError end - def set_initial(key) # rubocop:disable Lint/UnusedMethodArgument + def initial_set(key) # rubocop:disable Lint/UnusedMethodArgument fail NotImplementedError end diff --git a/lib/suo/client/memcached.rb b/lib/suo/client/memcached.rb index 7112200..a624490 100644 --- a/lib/suo/client/memcached.rb +++ b/lib/suo/client/memcached.rb @@ -20,7 +20,7 @@ module Suo @client.set_cas(key, newval, cas) end - def set_initial(key) + def initial_set(key) @client.set(key, "") end end diff --git a/lib/suo/client/redis.rb b/lib/suo/client/redis.rb index 8996bca..5f318d1 100644 --- a/lib/suo/client/redis.rb +++ b/lib/suo/client/redis.rb @@ -32,7 +32,7 @@ module Suo @client.unwatch end - def set_initial(key) + def initial_set(key) @client.set(key, "") end end diff --git a/test/client_test.rb b/test/client_test.rb index c7e7ec3..93544a9 100644 --- a/test/client_test.rb +++ b/test/client_test.rb @@ -87,7 +87,7 @@ module ClientTests ret.sort! assert_equal 0, output.size - assert_equal ["One", "Two"], ret + assert_equal %w(One Two), ret end def test_block_multiple_resource_locking @@ -98,7 +98,7 @@ module ClientTests 100.times.map do |i| Thread.new do - success = @client.lock(TEST_KEY, 50) do + success = client.lock(TEST_KEY, 50) do sleep(3) success_counter << i end diff --git a/test/test_helper.rb b/test/test_helper.rb index 5a3867f..e48593e 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -6,4 +6,3 @@ require "minitest/autorun" require "minitest/benchmark" ENV["SUO_TEST"] = "true" -