Commit Graph

59 Commits

Author SHA1 Message Date
KOBAYASHI Shuji 650ca7da17 Count skip tests 2019-03-05 19:53:25 +09:00
KOBAYASHI Shuji ee537eceee GEMNAME is undefined in bintest
ref: https://github.com/mruby/mruby/pull/4296#discussion_r261868710
2019-03-04 00:18:54 +09:00
KOBAYASHI Shuji c6b8106924 Simplify MRubyTestSkip in test/assert.rb 2019-03-03 18:58:11 +09:00
KOBAYASHI Shuji fdb7f9dad3 Remove unneeded => in test skip/error messages 2019-02-26 21:32:34 +09:00
KOBAYASHI Shuji 5c40203930 Refine mrbgem name in assertion failure/skip message for core test 2019-02-24 19:21:40 +09:00
Yukihiro "Matz" Matsumoto 769b56c3ae Merge pull request #4290 from shuujii/refactor-exception-handling-in-assert
Refactor exception handling in `assert`
2019-02-21 22:37:09 +09:00
KOBAYASHI Shuji ad789944db Refactor exception handling in assert 2019-02-21 17:44:45 +09:00
KOBAYASHI Shuji 244abdae09 assert_true/assert_false should pass when actual is only true/false
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
2019-02-20 18:49:38 +09:00
KOBAYASHI Shuji 6cdac5efb6 Lazy message/diff creation for assertion in test/assert.rb
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
2019-02-14 09:04:42 +09:00
KOBAYASHI Shuji e60f5f5cee Always through assert_true for assertion methods in test/assert.rb 2019-02-09 21:48:12 +09:00
KOBAYASHI Shuji 6f395a58d2 Add assert_same and assert_not_same 2019-01-05 20:41:09 +09:00
dearblue 9377da9775 Fix undefined variable is using 2018-12-21 23:44:38 +09:00
bamchoh 81dc383291 Use same format between Fail and Skip
We can see gem name in skip message by this fix
2017-12-09 02:12:37 +09:00
Christopher Aue bf32265743 Allowed to pass multiple exceptions to assert_raise 2017-08-30 11:03:51 +02:00
Christopher Aue 4b0b8f7e1a Refactored #assert_raise and #assert_nothing_raised 2017-08-29 23:25:53 +02:00
Christopher Aue 495a2e605d fixed printing failed assertions 2017-07-11 12:53:48 +02:00
Yukihiro "Matz" Matsumoto af0bef6dd8 Silence rubocop warnings. 2017-06-22 00:27:17 +09:00
Yukihiro "Matz" Matsumoto 057be5ffb5 use unless instead of if not. 2017-06-21 11:13:33 +09:00
Ryo Okubo f085baae06 Pass when assert returns a false value 2017-01-07 17:57:14 +09:00
Tomasz Dąbrowski a8b8abbd82 Fixed float tolerance in tests when MRB_USE_FLOAT is set 2016-11-24 12:48:41 +01:00
Tomasz Dąbrowski 617050450e test/assert.rb should not use puts 2016-11-10 13:17:59 +01:00
Yukihiro "Matz" Matsumoto 1d7d7062fc __t_printstr__ may not be available for tests 2015-12-31 00:55:07 +09:00
Yukihiro "Matz" Matsumoto 4fdec33ff4 simpler t_print 2015-12-30 14:25:05 +09:00
Daniel Bovensiepen a3111f144c Round execution time 2015-01-03 17:53:32 +08:00
take_cheeze a24729044a Print backtrace of crashed test in verbose mode. 2014-07-19 22:33:13 +09:00
Nobuyoshi Nakada ab67c57f65 remove trailing spaces 2014-04-30 09:50:14 +09:00
ksss 15eabcdbc4 Show error class name when raise Error 2014-03-31 08:14:14 +09:00
Yukihiro "Matz" Matsumoto 1b422befb1 revert 813ba5 since #1949 fixed 2014-03-26 17:53:22 +09:00
take_cheeze 813ba50bfb Don't use ensure to fix crash of mruby-eval test. 2014-03-26 12:59:56 +09:00
Yukihiro "Matz" Matsumoto 4592862b0d remove unnecessary operator method call; ref #1927 2014-03-24 09:17:09 +09:00
take_cheeze db5d78e229 Count crashed tests in total tests count. 2014-03-24 03:22:17 +09:00
Jun Hiroe d27dcbe9d2 Refactor assert_true 2014-03-16 23:26:29 +09:00
ksss 23680cb447 add assertion method `assert_nothing_raised' 2014-03-11 00:13:36 +09:00
fleuria 0a4010728a make test/assert.rb cruby compatible 2013-11-16 14:22:15 +08:00
Daniel Bovensiepen d5eab236e7 Fix assignment of block as actual value and not expected 2013-08-01 11:32:46 +08:00
Daniel Bovensiepen d8c8893e94 Implement assert_float and add block mode to assert_equal and assert_not_equal 2013-06-15 02:10:05 +08:00
Daniel Bovensiepen 5915874e01 Add assert_not_include to test environment 2013-06-09 05:16:10 +08:00
Daniel Bovensiepen 2d696b26b6 Add assert_not_equal 2013-06-09 04:48:53 +08:00
Ryan Scott 0d4227ac04 Implemented ObjectSpace.count_objects to count the number of allocated objects for each type 2013-05-12 18:42:21 +10:00
Daniel Bovensiepen 520b0f73bf Implement fallback print method for testing environment in case mruby-print GEM wasn't included. 2013-05-08 21:17:08 +08:00
Akira Yumiyama c86d76141c bugfix: assert_raise 2013-03-02 19:38:43 +09:00
Daniel Bovensiepen 81f96cb9af Move Math::TOLERANCE to mruby-math 2013-02-28 15:20:46 +00:00
mattn 6819505586 Add skip method for test 2013-02-25 20:26:21 +09:00
Yukihiro Matz Matsumoto a6767bd8bb rename assert_raises to assert_raise 2013-02-25 12:28:38 +09:00
Yukihiro Matz Matsumoto dbea1d2299 remove assert_instance_of and assert_kind_of which might hinder duck typing 2013-02-25 12:27:27 +09:00
Yukihiro Matz Matsumoto cf358aea9f rename assert_includes to assert_include 2013-02-25 12:26:27 +09:00
Akira Yumiyama f8bdc10cb1 add assert_{includes,instance_of,kind_of,raises} methods. 2013-02-22 13:16:47 +09:00
Akira Yumiyama f2c77ff212 add assert_{true,nil,equal} methods. 2013-02-18 12:32:26 +09:00
Akira Yumiyama 7c67bfedfd add mrbtest verbose mode ('-v' option) 2013-02-09 16:24:39 +09:00
Yuichiro MASUI 280bad605e Run mrbgems test run on isolate mrb_state each rb file.
Can access to current gem's name through GEMNAME from test.

Can change assert library each mrbgems. used spec.test_preload on mrbgem.rake.

assert library should set $ok_test, $ko_test, $kill_test, $asserts.
2013-01-07 02:58:36 +09:00