summaryrefslogtreecommitdiff
path: root/spec/mspec/lib
diff options
context:
space:
mode:
Diffstat (limited to 'spec/mspec/lib')
-rw-r--r--spec/mspec/lib/mspec/matchers/block_caller.rb6
-rw-r--r--spec/mspec/lib/mspec/utils/script.rb4
2 files changed, 7 insertions, 3 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
diff --git a/spec/mspec/lib/mspec/utils/script.rb b/spec/mspec/lib/mspec/utils/script.rb
index 24cd069bb4..db5a33a91a 100644
--- a/spec/mspec/lib/mspec/utils/script.rb
+++ b/spec/mspec/lib/mspec/utils/script.rb
@@ -39,8 +39,8 @@ class MSpecScript
end
def initialize
- ruby_version_is ""..."2.2" do
- abort "MSpec needs Ruby 2.2 or more recent"
+ ruby_version_is ""..."2.3" do
+ abort "MSpec needs Ruby 2.3 or more recent"
end
config[:formatter] = nil