Skip to content

Commit 2f3b3c2

Browse files
Merge pull request #365 from ruby-ldap/test-tweaks-20200712
Address some warnings and fix JRuby test omissions
2 parents e99aa98 + 39bf555 commit 2f3b3c2

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

lib/net/ldap/filter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ def to_ber
490490
when :eq
491491
if @right == "*" # presence test
492492
@left.to_s.to_ber_contextspecific(7)
493-
elsif @right =~ /[*]/ # substring
493+
elsif @right.to_s =~ /[*]/ # substring
494494
# Parsing substrings is a little tricky. We use String#split to
495495
# break a string into substrings delimited by the * (star)
496496
# character. But we also need to know whether there is a star at the

test/test_ldap_connection.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def test_connection_refused
9595

9696
def test_connection_timeout
9797
connection = Net::LDAP::Connection.new(:host => "fail.Errno::ETIMEDOUT", :port => 636, :socket_class => FakeTCPSocket)
98-
stderr = capture_stderr do
98+
capture_stderr do
9999
assert_raise Net::LDAP::Error do
100100
connection.socket
101101
end

test/test_snmp.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def self.raw_string(s)
1717
def test_invalid_packet
1818
data = "xxxx"
1919
assert_raise(Net::BER::BerError) do
20-
ary = data.read_ber(Net::SNMP::AsnSyntax)
20+
data.read_ber(Net::SNMP::AsnSyntax)
2121
end
2222
end
2323

test/test_ssl_ber.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,13 @@ def setup
3030
end
3131

3232
def test_transmit_strings
33-
omit "JRuby throws an error without a real socket"
34-
omit_if RUBY_PLATFORM == "java"
33+
omit_if RUBY_PLATFORM == "java", "JRuby throws an error without a real socket"
3534

3635
assert_equal "foo", transmit("foo")
3736
end
3837

3938
def test_transmit_ber_encoded_numbers
40-
omit "JRuby throws an error without a real socket"
41-
omit_if RUBY_PLATFORM == "java"
39+
omit_if RUBY_PLATFORM == "java", "JRuby throws an error without a real socket"
4240

4341
@to.write 1234.to_ber
4442
assert_equal 1234, @from.read_ber

0 commit comments

Comments
 (0)