1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
eregon 2017-12-01 15:41:23 +00:00
parent 0f42035eb9
commit 821d9a2d30
3 changed files with 7 additions and 7 deletions

View file

@ -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

View file

@ -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

View file

@ -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)