| Age | Commit message (Collapse) | Author |
|
The GitHub Super Linter is a more robust and better supported
tool than the current GitHub Actions we are using.
Running these checks:
ERROR_ON_MISSING_EXEC_BIT: true
VALIDATE_BASH: true
VALIDATE_BASH_EXEC: true
VALIDATE_EDITORCONFIG: true
VALIDATE_MARKDOWN: true
VALIDATE_SHELL_SHFMT: true
VALIDATE_YAML: true
https://github.com/marketplace/actions/super-linter
https://github.com/github/super-linter
Added the GitHub Super Linter badge to the README.
Also updated the pre-commit framework and added
more documentation on pre-commit.
Added one more pre-commit check: check-executables-have-shebangs
Added one extra check for merge conflicts to our
GitHub Actions.
EditorConfig and Markdown linting.
Minor grammar and spelling fixes.
Update linter.yml
|
|
Check if the constant GEMNAME is defined before use in `assert.rb`.
This is added to prevent an undefined constant error when using
`assert.rb` in other environments - for example, testing CRuby.
|
|
Backtrace is useful for debugging.
|
|
|
|
Refine message to `skip` in nested `assert`
|
|
- I think "Info" is used only to `skip`, so change to "Skip".
- Changed the default value of `assert` and specify the argument explicitly
at the caller of `assert` because it is unnatural "Assertion failed" is
output even though the assertion doesn't fail.
== Example:
def assert_foo(exp, act)
assert do
assert_equal exp[0], act[0]
assert_equal exp[1], act[1]
end
end
def assert_bar(exp, act)
assert do
skip
end
end
def assert_baz(exp, act)
assert do
assert_equal exp, act
assert_bar exp, act
end
end
assert 'test#skip_in_nested_assert' do
assert_baz 1, 1
end
=== Before this patch:
?..
Info: test#skip_in_nested_assert (core)
- Assertion[1]
Info: Assertion failed (core)
- Assertion[1-2]
Skip: Assertion failed (core)
Total: 3
OK: 2
KO: 0
Crash: 0
Warning: 0
Skip: 1
=== After this patch:
???
Skip: test#skip_in_nested_assert (core)
- Assertion[1]
Skip: assert (core)
- Assertion[1-2]
Skip: assert (core)
Total: 3
OK: 0
KO: 0
Crash: 0
Warning: 0
Skip: 3
|
|
|
|
|
|
shuujii/add-assert_raise_with_message-and-assert_raise_with_message_pattern
Add `assert_raise_with_message` and `assert_raise_with_message_pattern`
|
|
|
|
When nesting `assert` used in test, it is indented and displayed.
Assertion numbers are concatenated by `"-"` at this time.
The purpose is to match the apparent numbers when failing with `assert_mruby`
which is defined by `mrbgems/mruby-bin-mruby/bintest/mruby.rb` for example.
Child assertions "skip" and "info" are reported as parent assertions "info"
and `$ok_test += 1`. The child assertions "ko" and "crash" are reported as the
parent assertion "ko" and `$ko_test += 1`.
When child assertions are mixed, "ko" takes precedence.
Incompatibility:
- `$mrbtest_assert_idx` takes `nil` or an integer array object.
So far it was `nil` or an integer.
- `$asserts` points to the top of the internal stack in the `assert`.
- `$mrbtest_assert` points to the top of the internal stack in `assert`.
|
|
In case `obj2.==` is broken.
|
|
The default message for the second argument should be set to the first
argument because only one argument is normally specified.
|
|
|
|
Add `assert_match` and `assert_not_match`
|
|
|
|
|
|
Avoid arithmetic operations when `exp` and/or `act` are infinity or NaN.
|
|
|
|
|
|
`assert_float` is always passed when expected value and/or actual value are
infinity or NaN. This behavior seems unintentional.
Before this patch:
assert_float(Float::INFINITY, 1.0) #=> pass
assert_float(-Float::INFINITY, 1) #=> pass
assert_float(1, 1/0) #=> pass
assert_float(1, -1/0) #=> pass
assert_float(1.0, Float::NAN) #=> pass
assert_float(Float::NAN, 1) #=> pass
After this patch:
assert_float(Float::INFINITY, 1.0) #=> fail: Expected 1.0 to be Infinity.
assert_float(-Float::INFINITY, 1) #=> fail: Expected 1 to be -Infinity.
assert_float(1, 1/0) #=> fail: Expected Infinity to be 1.
assert_float(1, -1/0) #=> fail: Expected -Infinity to be 1.
assert_float(1.0, Float::NAN) #=> fail: Expected NaN to be 1.0.
assert_float(Float::NAN, 1) #=> fail: Expected 1 to be NaN.
|
|
|
|
Based on minitest RubyGem.
Example of before this patch:
- Assertion[1] Failed: Expected 1 to be 2
Expected: 2
Actual: 1
- Assertion[2] Failed: Expected [1, 3] to include 2
Collection: [1, 3]
Object: 2
Example of after this patch:
- Assertion[1]
Expected: 2
Actual: 1
- Assertion[2]
Expected [1, 3] to include 2.
|
|
- An exception do not raise when mrbtest fail.
- There are no useful informations in exception message and backtrace.
|
|
|
|
|
|
ref: https://github.com/mruby/mruby/pull/4296#discussion_r261868710
|
|
|
|
|
|
|
|
Refactor exception handling in `assert`
|
|
|
|
For the following reasons:
- Previous behavior is confusable because it's different from test/unit rubygem's `assert_true`
- Tests may pass unintentionally in an inappropriate way; ref #4285 #4287
|
|
Include the following changes too:
- Extract part of logic with block to a method
- Use `var ||= ...` instead of `var = ... unless var`
- Unify using parentheses for `t_print`
- Change methods order
|
|
|
|
|
|
|
|
We can see gem name in skip message by this fix
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|