summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/app_test.rb2
-rw-r--r--test/test_helper.rb12
2 files changed, 7 insertions, 7 deletions
diff --git a/test/app_test.rb b/test/app_test.rb
index de10989..4c997d7 100644
--- a/test/app_test.rb
+++ b/test/app_test.rb
@@ -40,7 +40,7 @@ class AppTest < HCl::TestCase
def test_socket_error
app = HCl::App.new
- app.expects(:show).raises(SocketError)
+ app.expects(:show).raises(Faraday::Error)
app.expects(:exit).with(1)
app.process_args('show').run
assert_match /connection failed/i, error_output
diff --git a/test/test_helper.rb b/test/test_helper.rb
index 95cb0b4..4d1c3a5 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -22,7 +22,7 @@ require 'hcl'
require 'minitest/autorun'
require 'mocha/setup'
require 'fileutils'
-require 'fakeweb'
+require 'faraday'
require 'debugger' if ENV['DEBUG']
# require test extensions/helpers
@@ -31,20 +31,20 @@ Dir[File.dirname(__FILE__) + '/ext/*.rb'].each { |ext| require ext }
class HCl::TestCase < MiniTest::Test
attr_reader :http
def setup
- FakeWeb.allow_net_connect = false
+ @stubs = Faraday::Adapter::Test::Stubs.new
@http = HCl::Net.new \
'login' => 'bob',
'password' => 'secret',
- 'subdomain' => 'bobclock'
+ 'subdomain' => 'bobclock',
+ 'test_adapter' => @stubs
end
def register_uri method, path, data={}
- FakeWeb.register_uri(method, "https://bob:secret@bobclock.harvestapp.com#{path}",
- body: Yajl::Encoder.encode(data))
+ @stubs.send(method, path) { [200, {}, Yajl::Encoder.encode(data)] }
end
def teardown
- FakeWeb.clean_registry
+ @stubs.verify_stubbed_calls
end
end