summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorZack Hobson2013-12-27 13:42:42 -0800
committerZack Hobson2013-12-27 13:44:14 -0800
commit7317487adc111ab6f226fc42b57dd6a32cb28541 (patch)
tree2053983a5ae51970c9fb89888aa16b3f34b412ee /test
parent4e6cf745e5d8426f1470c26f705bacbad1514e91 (diff)
downloadhcl-non-singleton-net.tar.bz2
completely eliminate the global http handle.non-singleton-net
Diffstat (limited to 'test')
-rw-r--r--test/net_test.rb16
-rw-r--r--test/test_helper.rb2
2 files changed, 9 insertions, 9 deletions
diff --git a/test/net_test.rb b/test/net_test.rb
index 882a09f..94e5ad4 100644
--- a/test/net_test.rb
+++ b/test/net_test.rb
@@ -3,10 +3,10 @@ require 'test_helper'
class NetTest < HCl::TestCase
def test_configure
- assert_equal 'bob', HCl::Net.login
- assert_equal 'secret', HCl::Net.password
- assert_equal 'bobclock', HCl::Net.subdomain
- assert_equal true, HCl::Net.ssl
+ assert_equal 'bob', http.login
+ assert_equal 'secret', http.password
+ assert_equal 'bobclock', http.subdomain
+ assert_equal true, http.ssl
end
def test_http_deep_unescape
@@ -14,7 +14,7 @@ class NetTest < HCl::TestCase
status:'gotten &amp; got!',
comparisons:['burrito &gt; taco', 'rain &lt; sun']
})
- body = HCl::Net.get 'foo'
+ body = http.get 'foo'
assert_equal 'gotten & got!', body[:status]
assert_equal 'burrito > taco', body[:comparisons][0]
assert_equal 'rain < sun', body[:comparisons][1]
@@ -22,19 +22,19 @@ class NetTest < HCl::TestCase
def test_http_get
register_uri(:get, "/foo", {message:'gotten!'})
- body = HCl::Net.get 'foo'
+ body = http.get 'foo'
assert_equal 'gotten!', body[:message]
end
def test_http_post
register_uri(:post, "/foo", {message:'posted!'})
- body = HCl::Net.post 'foo', {pizza:'taco'}
+ body = http.post 'foo', {pizza:'taco'}
assert_equal 'posted!', body[:message]
end
def test_http_delete
register_uri(:delete, "/foo", {message:'wiped!'})
- body = HCl::Net.delete 'foo'
+ body = http.delete 'foo'
assert_equal 'wiped!', body[:message]
end
end
diff --git a/test/test_helper.rb b/test/test_helper.rb
index 33cf499..dc052e2 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -31,7 +31,7 @@ class HCl::TestCase < MiniTest::Unit::TestCase
attr_reader :http
def setup
FakeWeb.allow_net_connect = false
- @http = HCl::Net.configure \
+ @http = HCl::Net.new \
'login' => 'bob',
'password' => 'secret',
'subdomain' => 'bobclock',