1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/test/fog/xml/connection_test.rb
Paul Thornthwaite 793506349d [core] Fix deprecated Mintest base
Used an old example, should have subclassed Minitest::Test
2014-03-03 09:59:58 +00:00

30 lines
808 B
Ruby

require "minitest/autorun"
require "fog"
# Note this is going to be part of fog-xml eventually
class TestFogXMLConnection < Minitest::Test
def setup
@connection = Fog::XML::Connection.new("http://localhost")
end
def teardown
Excon.stubs.clear
end
def test_respond_to_request
assert_respond_to @connection, :request
end
def test_request_with_parser
@parser = Fog::ToHashDocument.new
Excon.stub({}, { :status => 200, :body => "<xml></xml>" })
response = @connection.request(:parser => @parser, :mock => true)
assert_equal({ :xml => "" }, response.body)
end
def test_request_without_parser
Excon.stub({}, { :status => 200, :body => "<xml></xml>" })
response = @connection.request(:mock => true)
assert_equal("<xml></xml>", response.body)
end
end