Skip to content

Commit

Permalink
Fix capitalization issues in Minitest, address lints
Browse files Browse the repository at this point in the history
  • Loading branch information
petergoldstein committed Sep 24, 2023
1 parent b69b24e commit 8ca3784
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion test/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# Generate self-signed certs for SSL once per suite run.
CertificateGenerator.generate

module MiniTest
module Minitest
class Spec
include Memcached::Helper

Expand Down
64 changes: 32 additions & 32 deletions test/integration/test_quiet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
key = SecureRandom.hex(3)
value = SecureRandom.hex(3)

refute Thread.current[Dalli::QUIET]
refute_operator Thread.current, :[], Dalli::QUIET
dc.quiet do
assert Thread.current[Dalli::QUIET]
assert_operator Thread.current, :[], Dalli::QUIET

# Response should be nil
assert_nil dc.set(key, value)
end

refute Thread.current[Dalli::QUIET]
refute_operator Thread.current, :[], Dalli::QUIET

assert_equal value, dc.get(key)
end
Expand All @@ -36,9 +36,9 @@
value = SecureRandom.hex(3)
dc.set(existing, oldvalue)

refute Thread.current[Dalli::QUIET]
refute_operator Thread.current, :[], Dalli::QUIET
dc.quiet do
assert Thread.current[Dalli::QUIET]
assert_operator Thread.current, :[], Dalli::QUIET

# Response should be nil
assert_nil dc.add(key, value)
Expand All @@ -47,7 +47,7 @@
assert_nil dc.add(existing, value)
end

refute Thread.current[Dalli::QUIET]
refute_operator Thread.current, :[], Dalli::QUIET

assert_equal value, dc.get(key)
assert_equal oldvalue, dc.get(existing)
Expand All @@ -64,9 +64,9 @@
value = SecureRandom.hex(3)
dc.set(key, oldvalue)

refute Thread.current[Dalli::QUIET]
refute_operator Thread.current, :[], Dalli::QUIET
dc.quiet do
assert Thread.current[Dalli::QUIET]
assert_operator Thread.current, :[], Dalli::QUIET

# Response should be nil
assert_nil dc.replace(key, value)
Expand All @@ -75,7 +75,7 @@
assert_nil dc.replace(nonexistent, value)
end

refute Thread.current[Dalli::QUIET]
refute_operator Thread.current, :[], Dalli::QUIET

assert_equal value, dc.get(key)
assert_nil dc.get(nonexistent)
Expand All @@ -91,9 +91,9 @@
value = SecureRandom.hex(3)
dc.set(existing, value)

refute Thread.current[Dalli::QUIET]
refute_operator Thread.current, :[], Dalli::QUIET
dc.quiet do
assert Thread.current[Dalli::QUIET]
assert_operator Thread.current, :[], Dalli::QUIET

# Response should be nil
assert_nil dc.delete(existing)
Expand All @@ -102,7 +102,7 @@
assert_nil dc.delete(key)
end

refute Thread.current[Dalli::QUIET]
refute_operator Thread.current, :[], Dalli::QUIET

assert_nil dc.get(existing)
assert_nil dc.get(key)
Expand All @@ -117,15 +117,15 @@
value = SecureRandom.hex(3)
dc.set(key, value, 90, raw: true)

refute Thread.current[Dalli::QUIET]
refute_operator Thread.current, :[], Dalli::QUIET
dc.quiet do
assert Thread.current[Dalli::QUIET]
assert_operator Thread.current, :[], Dalli::QUIET

# Response should be nil
assert_nil dc.append(key, 'abc')
end

refute Thread.current[Dalli::QUIET]
refute_operator Thread.current, :[], Dalli::QUIET

assert_equal "#{value}abc", dc.get(key)
end
Expand All @@ -139,15 +139,15 @@
value = SecureRandom.hex(3)
dc.set(key, value, 90, raw: true)

refute Thread.current[Dalli::QUIET]
refute_operator Thread.current, :[], Dalli::QUIET
dc.quiet do
assert Thread.current[Dalli::QUIET]
assert_operator Thread.current, :[], Dalli::QUIET

# Response should be nil
assert_nil dc.prepend(key, 'abc')
end

refute Thread.current[Dalli::QUIET]
refute_operator Thread.current, :[], Dalli::QUIET

assert_equal "abc#{value}", dc.get(key)
end
Expand All @@ -162,15 +162,15 @@
incr = 134
dc.set(key, value, 90, raw: true)

refute Thread.current[Dalli::QUIET]
refute_operator Thread.current, :[], Dalli::QUIET
dc.quiet do
assert Thread.current[Dalli::QUIET]
assert_operator Thread.current, :[], Dalli::QUIET

# Response should be nil
assert_nil dc.incr(key, incr)
end

refute Thread.current[Dalli::QUIET]
refute_operator Thread.current, :[], Dalli::QUIET

assert_equal 680, dc.get(key).to_i
end
Expand All @@ -185,9 +185,9 @@
incr = 134
dc.set(key, value, 90, raw: true)

refute Thread.current[Dalli::QUIET]
refute_operator Thread.current, :[], Dalli::QUIET
dc.quiet do
assert Thread.current[Dalli::QUIET]
assert_operator Thread.current, :[], Dalli::QUIET

# Response should be nil
assert_nil dc.decr(key, incr)
Expand All @@ -202,9 +202,9 @@
dc.close
dc.flush

refute Thread.current[Dalli::QUIET]
refute_operator Thread.current, :[], Dalli::QUIET
dc.quiet do
assert Thread.current[Dalli::QUIET]
assert_operator Thread.current, :[], Dalli::QUIET

# Response should be a non-empty array of nils
arr = dc.flush(90)
Expand All @@ -213,7 +213,7 @@
assert arr.all?(&:nil?)
end

refute Thread.current[Dalli::QUIET]
refute_operator Thread.current, :[], Dalli::QUIET
end
end

Expand All @@ -227,13 +227,13 @@
assert_equal 'av', dc.get('a')
assert_equal 'bv', dc.get('b')

refute Thread.current[Dalli::QUIET]
refute_operator Thread.current, :[], Dalli::QUIET
dc.multi do
assert Thread.current[Dalli::QUIET]
assert_operator Thread.current, :[], Dalli::QUIET
dc.delete('non_existent_key')
end

refute Thread.current[Dalli::QUIET]
refute_operator Thread.current, :[], Dalli::QUIET
assert_equal 'av', dc.get('a')
assert_equal 'bv', dc.get('b')
end
Expand All @@ -249,15 +249,15 @@
assert_equal 'av', dc.get('a')
assert_equal 'bv', dc.get('b')

refute Thread.current[Dalli::QUIET]
refute_operator Thread.current, :[], Dalli::QUIET
dc.multi do
assert Thread.current[Dalli::QUIET]
assert_operator Thread.current, :[], Dalli::QUIET
assert_raises Dalli::NotPermittedMultiOpError do
dc.get('a')
end
end

refute Thread.current[Dalli::QUIET]
refute_operator Thread.current, :[], Dalli::QUIET
end
end

Expand Down
2 changes: 1 addition & 1 deletion test/test_client_options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
it 'not warn about valid options' do
dc = Dalli::Client.new('foo', compress: true)
# Rails.logger.expects :warn
assert dc.instance_variable_get(:@options)[:compress]
assert_operator dc.instance_variable_get(:@options), :[], :compress
end

describe 'servers configuration' do
Expand Down
2 changes: 1 addition & 1 deletion test/test_ring.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def weight
ring = Dalli::Ring.new(servers, TestServer, {})
previous_value = 0
ring.continuum.each do |entry|
assert entry.value > previous_value
assert_operator entry.value, :>, previous_value
previous_value = entry.value
end
end
Expand Down

0 comments on commit 8ca3784

Please sign in to comment.