summaryrefslogtreecommitdiff
path: root/test/net
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-19 07:45:58 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-19 07:45:58 +0000
commit311b7154839b91c87ee40908ac6d3f5c330d7b11 (patch)
tree5a751c1b132d593c10fc74b657471364136a35f1 /test/net
parent6286ff6301f94a475702d905cb722d3a4c7c4535 (diff)
test: use assert_not_*
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/net')
-rw-r--r--test/net/http/test_http.rb22
-rw-r--r--test/net/http/test_http_request.rb20
-rw-r--r--test/net/http/test_httpresponse.rb2
3 files changed, 22 insertions, 22 deletions
diff --git a/test/net/http/test_http.rb b/test/net/http/test_http.rb
index f1d3ede..4938235 100644
--- a/test/net/http/test_http.rb
+++ b/test/net/http/test_http.rb
@@ -14,7 +14,7 @@ class TestNetHTTP < Test::Unit::TestCase
proxy_class = Net::HTTP.Proxy 'proxy.example', 8000, 'user', 'pass'
- refute_equal Net::HTTP, proxy_class
+ assert_not_equal Net::HTTP, proxy_class
assert_operator proxy_class, :<, Net::HTTP
@@ -25,7 +25,7 @@ class TestNetHTTP < Test::Unit::TestCase
http = proxy_class.new 'hostname.example'
- refute http.proxy_from_env?
+ assert_not_predicate http, :proxy_from_env?
proxy_class = Net::HTTP.Proxy 'proxy.example'
@@ -43,7 +43,7 @@ class TestNetHTTP < Test::Unit::TestCase
proxy_class = Net::HTTP.Proxy :ENV
- refute_equal Net::HTTP, proxy_class
+ assert_not_equal Net::HTTP, proxy_class
assert_operator proxy_class, :<, Net::HTTP
@@ -51,7 +51,7 @@ class TestNetHTTP < Test::Unit::TestCase
assert_nil proxy_class.proxy_user
assert_nil proxy_class.proxy_pass
- refute_equal 8000, proxy_class.proxy_port
+ assert_not_equal 8000, proxy_class.proxy_port
http = proxy_class.new 'hostname.example'
@@ -488,7 +488,7 @@ module TestNetHTTP_version_1_2_methods
assert_equal $test_net_http_data.size, res.body.size
assert_equal $test_net_http_data, res.body
- refute res.decode_content, 'Bug #7831' if Net::HTTP::HAVE_ZLIB
+ assert_not_predicate res, :decode_content, 'Bug #7831' if Net::HTTP::HAVE_ZLIB
}
end
@@ -562,12 +562,12 @@ module TestNetHTTP_version_1_2_methods
assert_kind_of URI::Generic, req.uri
- refute_equal uri, req.uri
+ assert_not_equal uri, req.uri
assert_equal uri, res.uri
- refute_same uri, req.uri
- refute_same req.uri, res.uri
+ assert_not_same uri, req.uri
+ assert_not_same req.uri, res.uri
end
def _test_request__uri(http)
@@ -578,12 +578,12 @@ module TestNetHTTP_version_1_2_methods
assert_kind_of URI::Generic, req.uri
- refute_equal uri, req.uri
+ assert_not_equal uri, req.uri
assert_equal req.uri, res.uri
- refute_same uri, req.uri
- refute_same req.uri, res.uri
+ assert_not_same uri, req.uri
+ assert_not_same req.uri, res.uri
end
def _test_request__uri_host(http)
diff --git a/test/net/http/test_http_request.rb b/test/net/http/test_http_request.rb
index 35c935a..c2144d8 100644
--- a/test/net/http/test_http_request.rb
+++ b/test/net/http/test_http_request.rb
@@ -9,8 +9,8 @@ class HTTPRequestTest < Test::Unit::TestCase
req = Net::HTTP::Get.new '/'
assert_equal 'GET', req.method
- refute req.request_body_permitted?
- assert req.response_body_permitted?
+ assert_not_predicate req, :request_body_permitted?
+ assert_predicate req, :response_body_permitted?
expected = {
'accept' => %w[*/*],
@@ -27,8 +27,8 @@ class HTTPRequestTest < Test::Unit::TestCase
req = Net::HTTP::Get.new '/', 'Range' => 'bytes=0-9'
assert_equal 'GET', req.method
- refute req.request_body_permitted?
- assert req.response_body_permitted?
+ assert_not_predicate req, :request_body_permitted?
+ assert_predicate req, :response_body_permitted?
expected = {
'accept' => %w[*/*],
@@ -43,8 +43,8 @@ class HTTPRequestTest < Test::Unit::TestCase
req = Net::HTTP::Head.new '/'
assert_equal 'HEAD', req.method
- refute req.request_body_permitted?
- refute req.response_body_permitted?
+ assert_not_predicate req, :request_body_permitted?
+ assert_not_predicate req, :response_body_permitted?
expected = {
'accept' => %w[*/*],
@@ -61,8 +61,8 @@ class HTTPRequestTest < Test::Unit::TestCase
req2 = Net::HTTP::Get.new '/', 'accept-encoding' => 'identity'
- refute req2.decode_content,
- 'Bug #7381 - do not decode content if the user overrides'
+ assert_not_predicate req2, :decode_content,
+ 'Bug #7381 - do not decode content if the user overrides'
end if Net::HTTP::HAVE_ZLIB
def test_header_set
@@ -72,8 +72,8 @@ class HTTPRequestTest < Test::Unit::TestCase
req['accept-encoding'] = 'identity'
- refute req.decode_content,
- 'Bug #7831 - do not decode content if the user overrides'
+ assert_not_predicate req, :decode_content,
+ 'Bug #7831 - do not decode content if the user overrides'
end if Net::HTTP::HAVE_ZLIB
end
diff --git a/test/net/http/test_httpresponse.rb b/test/net/http/test_httpresponse.rb
index eb1a792..a494b7f 100644
--- a/test/net/http/test_httpresponse.rb
+++ b/test/net/http/test_httpresponse.rb
@@ -323,7 +323,7 @@ EOS
response.uri = uri
assert_equal uri, response.uri
- refute_same uri, response.uri
+ assert_not_same uri, response.uri
end
def test_ensure_zero_space_does_not_regress