mirror of
https://github.com/dkam/suo.git
synced 2025-01-29 07:42:43 +00:00
some style fixes
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -32,7 +32,7 @@ module Suo
|
||||
@client.unwatch
|
||||
end
|
||||
|
||||
def set_initial(key)
|
||||
def initial_set(key)
|
||||
@client.set(key, "")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -6,4 +6,3 @@ require "minitest/autorun"
|
||||
require "minitest/benchmark"
|
||||
|
||||
ENV["SUO_TEST"] = "true"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user