itimer 5 → 6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/itimer.rb +1 -1
- data/test/itimer.rb +17 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9303f43abb6d89f16d982ecd699badd4c2fcda54
|
4
|
+
data.tar.gz: 5a68f96c80393c9fe74f0240a051bcaea3a69c9b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d03a296115e138ac991c9b23ba4c24fc8bc947253fbd23b337c97e8adddc240634e21fd2973fce8e25c288082cbdb134969c16c2fe2816a2d3ce43f0e0ddc95d
|
7
|
+
data.tar.gz: d7f583044bc06894247b146f7bdcb36e1ef2934ee85cf714463fd9ab467952670664a77abc23626b7907a55363519569a38e5624100fe8cfa3d0b63868aa58b4
|
data/lib/itimer.rb
CHANGED
data/test/itimer.rb
CHANGED
@@ -118,6 +118,23 @@ class ItimerTest < Test::Unit::TestCase
|
|
118
118
|
end
|
119
119
|
assert( timeouts )
|
120
120
|
assert_in_delta( Time.now-start, 0.25, 0.1 )
|
121
|
+
|
122
|
+
start = Time.now
|
123
|
+
timeouts = false
|
124
|
+
assert_raise( Itimer::Timeout ) do
|
125
|
+
Itimer.timeout(0.25) do
|
126
|
+
begin
|
127
|
+
Itimer.timeout(3) do
|
128
|
+
sleep 1
|
129
|
+
end
|
130
|
+
rescue Itimer::Timeout
|
131
|
+
timeouts = true
|
132
|
+
end
|
133
|
+
sleep 1
|
134
|
+
end
|
135
|
+
end
|
136
|
+
assert( timeouts )
|
137
|
+
assert_in_delta( Time.now-start, 0.25, 0.1 )
|
121
138
|
end
|
122
139
|
|
123
140
|
def test_compat
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: itimer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '
|
4
|
+
version: '6'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nate Mueller
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake-compiler
|