ruby-changes:49167
From: eregon <ko1@a...>
Date: Sat, 16 Dec 2017 02:44:22 +0900 (JST)
Subject: [ruby-changes:49167] eregon:r61283 (trunk): Update to ruby/mspec@19d929e
eregon 2017-12-16 02:44:15 +0900 (Sat, 16 Dec 2017) New Revision: 61283 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61283 Log: Update to ruby/mspec@19d929e Added files: trunk/spec/mspec/lib/mspec/helpers/frozen_error_class.rb Modified files: trunk/spec/mspec/lib/mspec/helpers.rb trunk/spec/mspec/lib/mspec/runner/actions/leakchecker.rb Index: spec/mspec/lib/mspec/helpers/frozen_error_class.rb =================================================================== --- spec/mspec/lib/mspec/helpers/frozen_error_class.rb (nonexistent) +++ spec/mspec/lib/mspec/helpers/frozen_error_class.rb (revision 61283) @@ -0,0 +1,17 @@ https://github.com/ruby/ruby/blob/trunk/spec/mspec/lib/mspec/helpers/frozen_error_class.rb#L1 +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 Property changes on: spec/mspec/lib/mspec/helpers/frozen_error_class.rb ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +LF \ No newline at end of property Index: spec/mspec/lib/mspec/helpers.rb =================================================================== --- spec/mspec/lib/mspec/helpers.rb (revision 61282) +++ spec/mspec/lib/mspec/helpers.rb (revision 61283) @@ -3,6 +3,7 @@ require 'mspec/helpers/argv' https://github.com/ruby/ruby/blob/trunk/spec/mspec/lib/mspec/helpers.rb#L3 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' Index: spec/mspec/lib/mspec/runner/actions/leakchecker.rb =================================================================== --- spec/mspec/lib/mspec/runner/actions/leakchecker.rb (revision 61282) +++ spec/mspec/lib/mspec/runner/actions/leakchecker.rb (revision 61283) @@ -262,11 +262,11 @@ class LeakChecker https://github.com/ruby/ruby/blob/trunk/spec/mspec/lib/mspec/runner/actions/leakchecker.rb#L262 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/