Wrap text
|
|
diff --git a/lib/mspec/matchers/include.rb b/lib/mspec/matchers/include.rb
index c9be606..b4e5415 100644
--- a/lib/mspec/matchers/include.rb
+++ b/lib/mspec/matchers/include.rb
@@ -23,9 +23,10 @@ class IncludeMatcher
end
end
-class << self
- undef :include
+# Cannot override #include at the toplevel in MRI
+module MSpec
def include(*expected)
IncludeMatcher.new(*expected)
end
+ module_function :include
end
diff --git a/lib/mspec/runner/mspec.rb b/lib/mspec/runner/mspec.rb
index 1332a0e..d9c3489 100644
--- a/lib/mspec/runner/mspec.rb
+++ b/lib/mspec/runner/mspec.rb
@@ -117,7 +117,7 @@ module MSpec
def self.protect(msg, &block)
begin
- block.call
+ instance_eval &block
rescue Exception => e
register_exit 1
if current and current.state
|