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:
parent
b3744d8940
commit
47ca2bc45a
2 changed files with 17 additions and 10 deletions
|
@ -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
|
||||
|
|
10
tests/core/timeout_tests.rb
Normal file
10
tests/core/timeout_tests.rb
Normal 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
|
Loading…
Reference in a new issue