mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
3763ea8907
`TestFogXMLConnection` didn't really match with the file name of `test/fog/xml/connection_test.rb` due to the namespacing and placement of "Test"
30 lines
812 B
Ruby
30 lines
812 B
Ruby
require "minitest/autorun"
|
|
require "fog"
|
|
|
|
# Note this is going to be part of fog-xml eventually
|
|
class Fog::XML::ConnectionTest < 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
|