Unverified Commit d1cdb9ef authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

Merge pull request #4311 from shuujii/simplify-MRubyTestSkip-in-test-assert.rb

Simplify `MRubyTestSkip` in `test/assert.rb`
parents 83a1df37 c6b81069
...@@ -19,11 +19,8 @@ end ...@@ -19,11 +19,8 @@ end
# Create the assertion in a readable way # Create the assertion in a readable way
def assertion_string(err, str, iso=nil, e=nil, bt=nil) def assertion_string(err, str, iso=nil, e=nil, bt=nil)
msg = "#{err}#{str}" msg = "#{err}#{str}"
msg += " [#{iso}]" if iso && iso != '' msg += " [#{iso}]" if iso && !iso.empty?
if e msg += " => #{e}" if e && !e.to_s.empty?
m = e.respond_to?(:cause) ? e.cause : e.message
msg += " => #{m}" if m && !m.empty?
end
msg += " (#{GEMNAME == 'mruby-test' ? 'core' : "mrbgems: #{GEMNAME}"})" msg += " (#{GEMNAME == 'mruby-test' ? 'core' : "mrbgems: #{GEMNAME}"})"
if $mrbtest_assert && $mrbtest_assert.size > 0 if $mrbtest_assert && $mrbtest_assert.size > 0
$mrbtest_assert.each do |idx, assert_msg, diff| $mrbtest_assert.each do |idx, assert_msg, diff|
...@@ -258,12 +255,7 @@ end ...@@ -258,12 +255,7 @@ end
## ##
# Skip the test # Skip the test
class MRubyTestSkip < NotImplementedError class MRubyTestSkip < NotImplementedError; end
attr_accessor :cause
def initialize(cause)
@cause = cause
end
end
def skip(cause = "") def skip(cause = "")
raise MRubyTestSkip.new(cause) raise MRubyTestSkip.new(cause)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment