summaryrefslogtreecommitdiffstats
path: root/test/timesheet_resource_test.rb
diff options
context:
space:
mode:
authorZack Hobson2013-12-22 22:00:45 -0800
committerZack Hobson2013-12-22 22:00:45 -0800
commit50cbd47da7a54a46809a818a43e821431de258ce (patch)
tree9667675dda14c7281fc5d60535c9ec89ddb07807 /test/timesheet_resource_test.rb
parentfeac869bf567af57402eb206f1bf5dd62fa0e93f (diff)
downloadhcl-50cbd47da7a54a46809a818a43e821431de258ce.tar.bz2
extract net code into hcl::net
Diffstat (limited to 'test/timesheet_resource_test.rb')
-rw-r--r--test/timesheet_resource_test.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/timesheet_resource_test.rb b/test/timesheet_resource_test.rb
index 1f1b1de..7397c0e 100644
--- a/test/timesheet_resource_test.rb
+++ b/test/timesheet_resource_test.rb
@@ -4,7 +4,7 @@ class TimesheetResourceTest < HCl::TestCase
def setup
FakeWeb.allow_net_connect = false
- HCl::TimesheetResource.configure \
+ HCl::Net.configure \
'login' => 'bob',
'password' => 'secret',
'subdomain' => 'bobclock',
@@ -12,30 +12,30 @@ class TimesheetResourceTest < HCl::TestCase
end
def test_configure
- assert_equal 'bob', HCl::TimesheetResource.login
- assert_equal 'secret', HCl::TimesheetResource.password
- assert_equal 'bobclock', HCl::TimesheetResource.subdomain
- assert_equal true, HCl::TimesheetResource.ssl
+ assert_equal 'bob', HCl::Net.login
+ assert_equal 'secret', HCl::Net.password
+ assert_equal 'bobclock', HCl::Net.subdomain
+ assert_equal true, HCl::Net.ssl
end
def test_http_get
FakeWeb.register_uri(:get, "https://bob:secret@bobclock.harvestapp.com/foo",
:body => 'gotten!'.inspect)
- body = HCl::TimesheetResource.get 'foo'
+ body = HCl::Net.get 'foo'
assert_equal 'gotten!', body
end
def test_http_post
FakeWeb.register_uri(:post, "https://bob:secret@bobclock.harvestapp.com/foo",
:body => 'posted!'.inspect)
- body = HCl::TimesheetResource.post 'foo', {pizza:'taco'}
+ body = HCl::Net.post 'foo', {pizza:'taco'}
assert_equal 'posted!', body
end
def test_http_delete
FakeWeb.register_uri(:delete, "https://bob:secret@bobclock.harvestapp.com/foo",
:body => 'wiped!'.inspect)
- body = HCl::TimesheetResource.delete 'foo'
+ body = HCl::Net.delete 'foo'
assert_equal 'wiped!', body
end
end