mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
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:
+4
-4
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user