ruby-changes:48855
From: eregon <ko1@a...>
Date: Sat, 2 Dec 2017 00:41:29 +0900 (JST)
Subject: [ruby-changes:48855] eregon:r60972 (trunk): Update to ruby/mspec@b501ade
eregon 2017-12-02 00:41:23 +0900 (Sat, 02 Dec 2017) New Revision: 60972 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60972 Log: Update to ruby/mspec@b501ade Modified files: trunk/spec/mspec/lib/mspec/matchers/be_close.rb trunk/spec/mspec/spec/matchers/be_close_spec.rb trunk/spec/mspec/tool/remove_old_guards.rb Index: spec/mspec/tool/remove_old_guards.rb =================================================================== --- spec/mspec/tool/remove_old_guards.rb (revision 60971) +++ spec/mspec/tool/remove_old_guards.rb (revision 60972) @@ -36,6 +36,6 @@ def remove_guards(guard, keep) https://github.com/ruby/ruby/blob/trunk/spec/mspec/tool/remove_old_guards.rb#L36 end end -version = "2.2" +version = (ARGV[0] || "2.2") remove_guards(/ruby_version_is ["']#{version}["'] do/, true) remove_guards(/ruby_version_is ["'][0-9.]*["']...["']#{version}["'] do/, false) Index: spec/mspec/lib/mspec/matchers/be_close.rb =================================================================== --- spec/mspec/lib/mspec/matchers/be_close.rb (revision 60971) +++ spec/mspec/lib/mspec/matchers/be_close.rb (revision 60972) @@ -12,11 +12,11 @@ class BeCloseMatcher https://github.com/ruby/ruby/blob/trunk/spec/mspec/lib/mspec/matchers/be_close.rb#L12 end def failure_message - ["Expected #{@expected}", "to be within +/- #{@tolerance} of #{@actual}"] + ["Expected #{@actual}", "to be within #{@expected} +/- #{@tolerance}"] end def negative_failure_message - ["Expected #{@expected}", "not to be within +/- #{@tolerance} of #{@actual}"] + ["Expected #{@actual}", "not to be within #{@expected} +/- #{@tolerance}"] end end Index: spec/mspec/spec/matchers/be_close_spec.rb =================================================================== --- spec/mspec/spec/matchers/be_close_spec.rb (revision 60971) +++ spec/mspec/spec/matchers/be_close_spec.rb (revision 60972) @@ -34,13 +34,13 @@ describe BeCloseMatcher do https://github.com/ruby/ruby/blob/trunk/spec/mspec/spec/matchers/be_close_spec.rb#L34 it "provides a useful failure message" do matcher = BeCloseMatcher.new(5.0, 0.5) - matcher.matches?(5.5) - matcher.failure_message.should == ["Expected 5.0", "to be within +/- 0.5 of 5.5"] + matcher.matches?(6.5) + matcher.failure_message.should == ["Expected 6.5", "to be within 5.0 +/- 0.5"] end it "provides a useful negative failure message" do matcher = BeCloseMatcher.new(5.0, 0.5) - matcher.matches?(5.0) - matcher.negative_failure_message.should == ["Expected 5.0", "not to be within +/- 0.5 of 5.0"] + matcher.matches?(4.9) + matcher.negative_failure_message.should == ["Expected 4.9", "not to be within 5.0 +/- 0.5"] end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/