summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-01 15:41:23 +0000
committereregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-01 15:41:23 +0000
commit821d9a2d30f2e0d3f9009dc001b4b49aaa63c66e (patch)
tree73739873d20355a2cc091e8ae3b301363d60ac25
parent0f42035eb90c363e80e7abdecab0beb7c33deb8c (diff)
Update to ruby/mspec@b501ade
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--spec/mspec/lib/mspec/matchers/be_close.rb4
-rw-r--r--spec/mspec/spec/matchers/be_close_spec.rb8
-rw-r--r--spec/mspec/tool/remove_old_guards.rb2
3 files changed, 7 insertions, 7 deletions
diff --git a/spec/mspec/lib/mspec/matchers/be_close.rb b/spec/mspec/lib/mspec/matchers/be_close.rb
index 2cf0fba41f..8662aabd26 100644
--- a/spec/mspec/lib/mspec/matchers/be_close.rb
+++ b/spec/mspec/lib/mspec/matchers/be_close.rb
@@ -12,11 +12,11 @@ class BeCloseMatcher
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
diff --git a/spec/mspec/spec/matchers/be_close_spec.rb b/spec/mspec/spec/matchers/be_close_spec.rb
index 3ced61dc7a..9b6e56e6d5 100644
--- a/spec/mspec/spec/matchers/be_close_spec.rb
+++ b/spec/mspec/spec/matchers/be_close_spec.rb
@@ -34,13 +34,13 @@ describe BeCloseMatcher do
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
diff --git a/spec/mspec/tool/remove_old_guards.rb b/spec/mspec/tool/remove_old_guards.rb
index d0920344eb..feb4ee4662 100644
--- a/spec/mspec/tool/remove_old_guards.rb
+++ b/spec/mspec/tool/remove_old_guards.rb
@@ -36,6 +36,6 @@ def remove_guards(guard, keep)
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)