aboutsummaryrefslogtreecommitdiffstats
path: root/test/envutil.rb
diff options
context:
space:
mode:
authorZachary Scott <e@zzak.io>2015-03-26 01:53:59 -0700
committerZachary Scott <e@zzak.io>2015-03-26 01:53:59 -0700
commita0e0036d4380b3cbb595904ca636cc4341a3b663 (patch)
treee0a51e674dbb45e01ca0c3fb8414350a2aec8adb /test/envutil.rb
parent30b43508092659adc0a9f7f038c5e0f9f4435de3 (diff)
downloadruby-openssl-a0e0036d4380b3cbb595904ca636cc4341a3b663.tar.gz
Copy this method from ruby-trunk to fix failing test
Found in test/lib/minitest/unit.rb
Diffstat (limited to 'test/envutil.rb')
-rw-r--r--test/envutil.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/envutil.rb b/test/envutil.rb
index 5a62977a..c5d45854 100644
--- a/test/envutil.rb
+++ b/test/envutil.rb
@@ -476,6 +476,14 @@ eom
pend
end
+ def message msg = nil, ending = ".", &default
+ proc {
+ msg = msg.call.chomp(".") if Proc === msg
+ custom_message = "#{msg}.\n" unless msg.nil? or msg.to_s.empty?
+ "#{custom_message}#{default.call}#{ending}"
+ }
+ end
+
def assert_is_minus_zero(f)
assert(1.0/f == -Float::INFINITY, "#{f} is not -0.0")
end