2013-06-25 09:31:18 -04:00
|
|
|
Shindo.tests('Fog::Core::Connection', ['core']) do
|
2013-06-25 08:51:53 -04:00
|
|
|
|
|
|
|
raises(ArgumentError, "raises ArgumentError when no arguments given") do
|
2013-06-25 09:31:18 -04:00
|
|
|
Fog::Core::Connection.new
|
2013-06-25 08:51:53 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
tests('new("http://example.com")') do
|
2013-06-25 09:31:18 -04:00
|
|
|
@instance = Fog::Core::Connection.new("http://example.com")
|
2013-06-25 08:51:53 -04:00
|
|
|
responds_to([:request, :reset])
|
|
|
|
|
|
|
|
tests('user agent').returns("fog/#{Fog::VERSION}") do
|
|
|
|
@instance.instance_variable_get(:@excon).data[:headers]['User-Agent']
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
tests('new("http://example.com", true)') do
|
2013-06-25 09:31:18 -04:00
|
|
|
Fog::Core::Connection.new("http://example.com", true)
|
2013-06-25 08:51:53 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
tests('new("http://example.com", false, options")') do
|
|
|
|
options = {
|
|
|
|
:debug_response => false
|
|
|
|
}
|
2013-06-25 09:31:18 -04:00
|
|
|
Fog::Core::Connection.new("http://example.com", true, options)
|
2013-06-25 08:51:53 -04:00
|
|
|
end
|
|
|
|
end
|