lock_method 0.5.4 → 0.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +7 -0
- data/lib/lock_method.rb +1 -3
- data/lib/lock_method/lock.rb +1 -1
- data/lib/lock_method/version.rb +1 -1
- data/test/shared_tests.rb +16 -0
- metadata +2 -2
data/CHANGELOG
CHANGED
data/lib/lock_method.rb
CHANGED
data/lib/lock_method/lock.rb
CHANGED
data/lib/lock_method/version.rb
CHANGED
data/test/shared_tests.rb
CHANGED
@@ -228,4 +228,20 @@ module SharedTests
|
|
228
228
|
BlogBlock.get_latest_entries { $stderr.write "i'm now allowed" }
|
229
229
|
end
|
230
230
|
end
|
231
|
+
|
232
|
+
def test_016_gives_clear_exception_message
|
233
|
+
blocker = Thread.new { Blog2.get_latest_entries }
|
234
|
+
|
235
|
+
# give it a bit of time to lock
|
236
|
+
sleep 1
|
237
|
+
|
238
|
+
# the blocker won't have finished
|
239
|
+
exception = assert_raises(LockMethod::Locked) do
|
240
|
+
Blog2.get_latest_entries
|
241
|
+
end
|
242
|
+
assert_match /get_latest_entries/, exception.message
|
243
|
+
|
244
|
+
# wait to finish
|
245
|
+
blocker.join
|
246
|
+
end
|
231
247
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lock_method
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-05-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: cache
|