summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-15 17:44:15 +0000
committereregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-15 17:44:15 +0000
commit60e21a9e9378c6126bff07fa10d362ce54718e77 (patch)
tree9fba27ee8df8672f66d16503d997d4fe1ce3df56
parent7c4306e6e9c3c4a255f4ad20134c1832dbe45ba2 (diff)
Update to ruby/mspec@19d929e
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--spec/mspec/lib/mspec/helpers.rb1
-rw-r--r--spec/mspec/lib/mspec/helpers/frozen_error_class.rb17
-rw-r--r--spec/mspec/lib/mspec/runner/actions/leakchecker.rb4
3 files changed, 20 insertions, 2 deletions
diff --git a/spec/mspec/lib/mspec/helpers.rb b/spec/mspec/lib/mspec/helpers.rb
index 90f9fd3fd4..b7ac9f4e85 100644
--- a/spec/mspec/lib/mspec/helpers.rb
+++ b/spec/mspec/lib/mspec/helpers.rb
@@ -3,6 +3,7 @@ require 'mspec/helpers/argv'
require 'mspec/helpers/datetime'
require 'mspec/helpers/fixture'
require 'mspec/helpers/flunk'
+require 'mspec/helpers/frozen_error_class'
require 'mspec/helpers/fs'
require 'mspec/helpers/io'
require 'mspec/helpers/mock_to_path'
diff --git a/spec/mspec/lib/mspec/helpers/frozen_error_class.rb b/spec/mspec/lib/mspec/helpers/frozen_error_class.rb
new file mode 100644
index 0000000000..26788ad9ad
--- /dev/null
+++ b/spec/mspec/lib/mspec/helpers/frozen_error_class.rb
@@ -0,0 +1,17 @@
+require 'mspec/guards/version'
+
+# This helper makes it easy to write version independent
+# specs for frozen objects.
+unless respond_to? :frozen_error_class
+ ruby_version_is "2.5" do
+ def frozen_error_class
+ FrozenError
+ end
+ end
+
+ ruby_version_is ""..."2.5" do
+ def frozen_error_class
+ RuntimeError
+ end
+ end
+end
diff --git a/spec/mspec/lib/mspec/runner/actions/leakchecker.rb b/spec/mspec/lib/mspec/runner/actions/leakchecker.rb
index e947cda9ff..ec17a156bf 100644
--- a/spec/mspec/lib/mspec/runner/actions/leakchecker.rb
+++ b/spec/mspec/lib/mspec/runner/actions/leakchecker.rb
@@ -262,11 +262,11 @@ class LeakChecker
leaked = false
if new_internal != old_internal
leaked = true
- puts "Encoding.default_internal changed: #{test_name} : #{old_internal} to #{new_internal}"
+ puts "Encoding.default_internal changed: #{test_name} : #{old_internal.inspect} to #{new_internal.inspect}"
end
if new_external != old_external
leaked = true
- puts "Encoding.default_external changed: #{test_name} : #{old_external} to #{new_external}"
+ puts "Encoding.default_external changed: #{test_name} : #{old_external.inspect} to #{new_external.inspect}"
end
@encoding_info = [new_internal, new_external]
return leaked