diff options
author | Zachary Scott <e@zzak.io> | 2015-03-26 01:53:59 -0700 |
---|---|---|
committer | Zachary Scott <e@zzak.io> | 2015-03-26 01:53:59 -0700 |
commit | a0e0036d4380b3cbb595904ca636cc4341a3b663 (patch) | |
tree | e0a51e674dbb45e01ca0c3fb8414350a2aec8adb /test/envutil.rb | |
parent | 30b43508092659adc0a9f7f038c5e0f9f4435de3 (diff) | |
download | ruby-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.rb | 8 |
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 |