1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[core] Adds initial Fog::Connection tests

Basic tests to ensure `Fog::Connection` is tested based on it's current
interface.
This commit is contained in:
Paul Thornthwaite 2013-06-25 13:51:53 +01:00
parent 4123be9568
commit b131269f21
2 changed files with 26 additions and 6 deletions

View file

@ -0,0 +1,26 @@
Shindo.tests('Fog::Connection', ['core']) do
raises(ArgumentError, "raises ArgumentError when no arguments given") do
Fog::Connection.new
end
tests('new("http://example.com")') do
@instance = Fog::Connection.new("http://example.com")
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
Fog::Connection.new("http://example.com", true)
end
tests('new("http://example.com", false, options")') do
options = {
:debug_response => false
}
Fog::Connection.new("http://example.com", true, options)
end
end

View file

@ -1,6 +0,0 @@
Shindo.tests('Fog::Connection', 'core') do
tests('user_agent').returns("fog/#{Fog::VERSION}") do
conn = Fog::Connection.new("http://www.testserviceurl.com", false, {})
conn.instance_variable_get(:@excon).data[:headers]['User-Agent']
end
end