Skip to content

Commit 7a4dda5

Browse files
committed
Switch to assert from assert_predicate
1 parent 27bd182 commit 7a4dda5

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

test/ber/test_ber.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,23 +103,23 @@ def test_binary_data
103103
data = ["6a31b4a12aa27a41aca9603f27dd5116"].pack("H*").force_encoding("ASCII-8BIT")
104104
bis = Net::BER::BerIdentifiedString.new(data)
105105

106-
assert_predicate bis, :valid_encoding?
106+
assert bis.valid_encoding?, "should be a valid encoding"
107107
assert_equal "ASCII-8BIT", bis.encoding.name
108108
end
109109

110110
def test_ascii_data_in_utf8
111111
data = "some text".force_encoding("UTF-8")
112112
bis = Net::BER::BerIdentifiedString.new(data)
113113

114-
assert_predicate bis, :valid_encoding?
114+
assert bis.valid_encoding?, "should be a valid encoding"
115115
assert_equal "UTF-8", bis.encoding.name
116116
end
117117

118118
def test_ut8_data_in_utf8
119119
data = ["e4b8ad"].pack("H*").force_encoding("UTF-8")
120120
bis = Net::BER::BerIdentifiedString.new(data)
121121

122-
assert_predicate bis, :valid_encoding?
122+
assert bis.valid_encoding?, "should be a valid encoding"
123123
assert_equal "UTF-8", bis.encoding.name
124124
end
125125
end

test/test_ldap_connection.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def test_error_failed_operation
5959
@tcp_socket.should_receive(:read_ber).and_return([2, ber])
6060

6161
result = @connection.modify(:dn => "1", :operations => [[:replace, "mail", "something@sothsdkf.com"]])
62-
assert_predicate result, :failure?
62+
assert result.failure?, "should be failure"
6363
assert_equal "The provided password value was rejected by a password validator: The provided password did not contain enough characters from the character set 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'. The minimum number of characters from that set that must be present in user passwords is 1", result.error_message
6464
end
6565

@@ -69,7 +69,7 @@ def test_no_error_on_success
6969
@tcp_socket.should_receive(:read_ber).and_return([2, ber])
7070

7171
result = @connection.modify(:dn => "1", :operations => [[:replace, "mail", "something@sothsdkf.com"]])
72-
assert_predicate result, :success?
72+
assert result.success?, "should be success"
7373
assert_equal "", result.error_message
7474
end
7575
end
@@ -96,7 +96,7 @@ def test_write_net_ldap_connection_event
9696
events = @service.subscribe "write.net_ldap_connection"
9797

9898
result = @connection.bind(method: :anon)
99-
assert_predicate result, :success?
99+
assert result.success?, "should be success"
100100

101101
# a write event
102102
payload, result = events.pop
@@ -113,7 +113,7 @@ def test_read_net_ldap_connection_event
113113
events = @service.subscribe "read.net_ldap_connection"
114114

115115
result = @connection.bind(method: :anon)
116-
assert_predicate result, :success?
116+
assert result.success?, "should be success"
117117

118118
# a read event
119119
payload, result = events.pop
@@ -130,12 +130,12 @@ def test_bind_net_ldap_connection_event
130130
events = @service.subscribe "bind.net_ldap_connection"
131131

132132
result = @connection.bind(method: :anon)
133-
assert_predicate result, :success?
133+
assert result.success?, "should be success"
134134

135135
# a read event
136136
payload, result = events.pop
137137
assert payload.has_key?(:result)
138-
assert_predicate result, :success?
138+
assert result.success?, "should be success"
139139
end
140140

141141
def test_search_net_ldap_connection_event
@@ -156,7 +156,7 @@ def test_search_net_ldap_connection_event
156156
events = @service.subscribe "search.net_ldap_connection"
157157

158158
result = @connection.search(filter: "(uid=user1)")
159-
assert_predicate result, :success?
159+
assert result.success?, "should be success"
160160

161161
# a search event
162162
payload, result = events.pop

0 commit comments

Comments
 (0)