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

Merge pull request #416 from dylanegan/timeout_cleaner

Clean up timeout and add tests.
This commit is contained in:
Wesley Beary 2011-07-12 09:02:41 -07:00
commit 5ceabd61f2
2 changed files with 17 additions and 10 deletions

View file

@ -1,13 +1,10 @@
module Fog
def self.timeout
@timeout ||= 600
end
@timeout = 600
def self.timeout
@timeout
end
def self.timeout=(new_timeout)
raise ArgumentError, "timeout must be non-negative" unless new_timeout >= 0
@timeout = new_timeout
end
def self.timeout=(timeout)
raise ArgumentError, "timeout must be non-negative" unless timeout >= 0
@timeout = timeout
end
end

View file

@ -0,0 +1,10 @@
Shindo.tests('Fog#timeout', 'core') do
tests('timeout').returns(600) do
Fog.timeout
end
tests('timeout = 300').returns(300) do
Fog.timeout = 300
Fog.timeout
end
end