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

Clean up timeout and add tests.

This commit is contained in:
Dylan Egan 2011-07-12 13:05:54 +10:00
parent b3744d8940
commit 47ca2bc45a
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