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:
parent
4123be9568
commit
b131269f21
2 changed files with 26 additions and 6 deletions
26
tests/core/connection_tests.rb
Normal file
26
tests/core/connection_tests.rb
Normal 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
|
|
@ -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
|
Loading…
Reference in a new issue