Merge pull request #4606 from shuujii/refine-message-to-skip-in-nested-assert

Refine message to `skip` in nested `assert`
This commit is contained in:
Yukihiro "Matz" Matsumoto
2019-07-30 14:41:09 +09:00
committed by GitHub
7 changed files with 11 additions and 11 deletions
+4 -4
View File
@@ -76,7 +76,7 @@ end
# iso : The ISO reference code of the feature
# which will be tested by this
# assertion
def assert(str = 'Assertion failed', iso = '')
def assert(str = 'assert', iso = '')
t_print(str, (iso != '' ? " [#{iso}]" : ''), ' : ') if $mrbtest_verbose
begin
$mrbtest_child_noassert ||= [0]
@@ -99,10 +99,10 @@ def assert(str = 'Assertion failed', iso = '')
yield
if $mrbtest_assert.size > 0
if $mrbtest_assert.size == $mrbtest_child_noassert[-1]
$asserts.push(assertion_string('Info: ', str, iso))
$asserts.push(assertion_string('Skip: ', str, iso))
$mrbtest_child_noassert[-2] += 1
$ok_test += 1
t_print('.')
$skip_test += 1
t_print('?')
else
$asserts.push(assertion_string('Fail: ', str, iso))
$ko_test += 1
+1 -1
View File
@@ -8,7 +8,7 @@ def assert_step(exp, receiver, args, inf: false)
break if inf && exp.size == act.size
end
expr = "#{receiver.inspect}.step(#{args.map(&:inspect).join(', ')})"
assert do
assert "assert_step" do
assert_true(exp.eql?(act), "#{expr}: counters", assertion_diff(exp, act))
assert_same(receiver, ret, "#{expr}: return value") unless inf
end