Skip to content

Commit

Permalink
Add logger as a dependency, drop ostruct for tests (#1010)
Browse files Browse the repository at this point in the history
* Add logger as a dependency

There was a warning in ruby-head (3.4) that in Ruby 3.5 logger and
ostruct will not be built-in gems, but regular gems.

This change avoids that warning.

The ostruct dependency was be omitted.

* Lint: Style/SymbolProc
  • Loading branch information
olleolleolle authored Sep 16, 2024
1 parent 1d4cbfc commit 718cacb
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 2 additions & 0 deletions dalli.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@ Gem::Specification.new do |s|
'changelog_uri' => 'https://github.com/petergoldstein/dalli/blob/main/CHANGELOG.md',
'rubygems_mfa_required' => 'true'
}

s.add_dependency 'logger'
end
1 change: 0 additions & 1 deletion test/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

require 'dalli'
require 'logger'
require 'ostruct'
require 'securerandom'

Dalli.logger = Logger.new($stdout)
Expand Down
4 changes: 2 additions & 2 deletions test/integration/test_network.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

describe 'with a fake server' do
it 'handle connection reset' do
memcached_mock(->(sock) { sock.close }) do
memcached_mock(lambda(&:close)) do
dc = Dalli::Client.new('localhost:19123')
assert_raises Dalli::RingError, message: 'No server available' do
dc.get('abc')
Expand All @@ -25,7 +25,7 @@

it 'handle connection reset with unix socket' do
socket_path = MemcachedMock::UNIX_SOCKET_PATH
memcached_mock(->(sock) { sock.close }, :start_unix, socket_path) do
memcached_mock(lambda(&:close), :start_unix, socket_path) do
dc = Dalli::Client.new(socket_path)
assert_raises Dalli::RingError, message: 'No server available' do
dc.get('abc')
Expand Down
1 change: 0 additions & 1 deletion test/protocol/test_binary.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: true

require 'ostruct'
require_relative '../helper'

describe Dalli::Protocol::Binary do
Expand Down

0 comments on commit 718cacb

Please sign in to comment.