summaryrefslogtreecommitdiff
path: root/spec/mspec/lib/mspec/matchers/block_caller.rb
diff options
context:
space:
mode:
authoreregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-04-28 19:49:24 +0000
committereregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-04-28 19:49:24 +0000
commit702eb2c8bf0df9a4a897b862e5017eaa31d5b128 (patch)
treec7e49529d542a6d92875ce415075a14a50b05cc6 /spec/mspec/lib/mspec/matchers/block_caller.rb
parent703a5dd3e0effdc808b9b59af21e5012f3d91942 (diff)
Update to ruby/mspec@b5b13de
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63291 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/mspec/lib/mspec/matchers/block_caller.rb')
-rw-r--r--spec/mspec/lib/mspec/matchers/block_caller.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/spec/mspec/lib/mspec/matchers/block_caller.rb b/spec/mspec/lib/mspec/matchers/block_caller.rb
index 017bce3cb7..4149586747 100644
--- a/spec/mspec/lib/mspec/matchers/block_caller.rb
+++ b/spec/mspec/lib/mspec/matchers/block_caller.rb
@@ -10,7 +10,11 @@ class BlockingMatcher
blocking = false
end
- while !started and status = thread.status and status != "sleep"
+ Thread.pass while !started
+
+ # Wait until the Thread status is "sleep" (then it's blocking)
+ # or nil (the Thread finished execution, it did not block)
+ while status = thread.status and status != "sleep"
Thread.pass
end
thread.kill