test-unit 3.2.9 → 3.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/BSDL +24 -0
- data/COPYING +41 -44
- data/README.md +18 -11
- data/Rakefile +0 -23
- data/doc/text/getting-started.md +2 -2
- data/doc/text/news.md +329 -1
- data/lib/test/unit/assertion-failed-error.rb +35 -0
- data/lib/test/unit/assertions.rb +453 -161
- data/lib/test/unit/attribute.rb +3 -1
- data/lib/test/unit/autorunner.rb +78 -30
- data/lib/test/unit/code-snippet-fetcher.rb +7 -7
- data/lib/test/unit/collector/descendant.rb +1 -0
- data/lib/test/unit/collector/dir.rb +4 -2
- data/lib/test/unit/collector/load.rb +3 -3
- data/lib/test/unit/collector/objectspace.rb +1 -0
- data/lib/test/unit/collector.rb +31 -0
- data/lib/test/unit/color-scheme.rb +20 -2
- data/lib/test/unit/data-sets.rb +26 -15
- data/lib/test/unit/data.rb +5 -5
- data/lib/test/unit/diff.rb +2 -3
- data/lib/test/unit/fixture.rb +6 -0
- data/lib/test/unit/notification.rb +9 -7
- data/lib/test/unit/omission.rb +34 -31
- data/lib/test/unit/pending.rb +12 -11
- data/lib/test/unit/priority.rb +7 -5
- data/lib/test/unit/runner/console.rb +0 -17
- data/lib/test/unit/testcase.rb +222 -146
- data/lib/test/unit/testsuite.rb +1 -1
- data/lib/test/unit/ui/console/testrunner.rb +58 -49
- data/lib/test/unit/util/memory-usage.rb +47 -0
- data/lib/test/unit/util/observable.rb +2 -2
- data/lib/test/unit/util/output.rb +5 -4
- data/lib/test/unit/version.rb +1 -1
- data/lib/test/unit/warning.rb +3 -0
- data/lib/test/unit.rb +177 -161
- data/lib/test-unit.rb +2 -17
- metadata +14 -91
- data/GPL +0 -339
- data/LGPL +0 -502
- data/test/collector/test-descendant.rb +0 -182
- data/test/collector/test-load.rb +0 -442
- data/test/collector/test_dir.rb +0 -407
- data/test/collector/test_objectspace.rb +0 -102
- data/test/fixtures/header-label.csv +0 -3
- data/test/fixtures/header-label.tsv +0 -3
- data/test/fixtures/header.csv +0 -3
- data/test/fixtures/header.tsv +0 -3
- data/test/fixtures/no-header.csv +0 -2
- data/test/fixtures/no-header.tsv +0 -2
- data/test/fixtures/plus.csv +0 -3
- data/test/run-test.rb +0 -22
- data/test/test-assertions.rb +0 -2180
- data/test/test-attribute-matcher.rb +0 -38
- data/test/test-attribute.rb +0 -123
- data/test/test-code-snippet.rb +0 -37
- data/test/test-color-scheme.rb +0 -82
- data/test/test-color.rb +0 -47
- data/test/test-data.rb +0 -419
- data/test/test-diff.rb +0 -518
- data/test/test-emacs-runner.rb +0 -60
- data/test/test-error.rb +0 -26
- data/test/test-failure.rb +0 -33
- data/test/test-fault-location-detector.rb +0 -163
- data/test/test-fixture.rb +0 -713
- data/test/test-notification.rb +0 -33
- data/test/test-omission.rb +0 -81
- data/test/test-pending.rb +0 -70
- data/test/test-priority.rb +0 -173
- data/test/test-test-case.rb +0 -1279
- data/test/test-test-result.rb +0 -113
- data/test/test-test-suite-creator.rb +0 -97
- data/test/test-test-suite.rb +0 -151
- data/test/testunit-test-util.rb +0 -31
- data/test/ui/test_testrunmediator.rb +0 -20
- data/test/util/test-method-owner-finder.rb +0 -38
- data/test/util/test-output.rb +0 -11
- data/test/util/test_backtracefilter.rb +0 -52
- data/test/util/test_observable.rb +0 -102
- data/test/util/test_procwrapper.rb +0 -36
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e09829655cd246a5ea493def950c9475a3d48afb21b2b97796e08cbb9da88a93
|
4
|
+
data.tar.gz: 530f99f43549ba9e89d9de1ead6ec95d299003142fb4ce31c22bff6a695e6bb2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2fabe6d0279022b6fa604da838f46274f396de22880c8d7fc6ad02f7dbc814b1220548d19ee03bb48589bbbd3b7aa125ec75387e965221e1b61489a9c27f92fb
|
7
|
+
data.tar.gz: 9f8cfd6da553913832c84436aea0639ec28c0800a9d02a28c24f91557207c8aa9defba4db4bc384c9c7e86138ff48331533afaed63a7da374b9a4ecd6467f9ec
|
data/BSDL
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
Copyright (C) 2003-2007 Nathaniel Talbott. All rights reserved.
|
2
|
+
Copyright (C) 2008 Ryan Davis. All rights reserved.
|
3
|
+
Copyright (C) 2008-2020 Sutou Kouhei. All rights reserved.
|
4
|
+
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
6
|
+
modification, are permitted provided that the following conditions
|
7
|
+
are met:
|
8
|
+
1. Redistributions of source code must retain the above copyright
|
9
|
+
notice, this list of conditions and the following disclaimer.
|
10
|
+
2. Redistributions in binary form must reproduce the above copyright
|
11
|
+
notice, this list of conditions and the following disclaimer in the
|
12
|
+
documentation and/or other materials provided with the distribution.
|
13
|
+
|
14
|
+
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
15
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
16
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
17
|
+
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
18
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
19
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
20
|
+
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
21
|
+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
22
|
+
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
23
|
+
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
24
|
+
SUCH DAMAGE.
|
data/COPYING
CHANGED
@@ -2,66 +2,63 @@ test-unit is copyrighted free software by Kouhei Sutou
|
|
2
2
|
<kou@cozmixng.org>, Ryan Davis <ryand-ruby@zenspider.com>
|
3
3
|
and Nathaniel Talbott <nathaniel@talbott.ws>.
|
4
4
|
|
5
|
-
You can redistribute it and/or modify it under either the terms of the
|
6
|
-
|
5
|
+
You can redistribute it and/or modify it under either the terms of the
|
6
|
+
2-clause BSDL (see the file BSDL), or the conditions below:
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
1. You may make and give away verbatim copies of the source form of the
|
9
|
+
software without restriction, provided that you duplicate all of the
|
10
|
+
original copyright notices and associated disclaimers.
|
11
11
|
|
12
|
-
|
13
|
-
|
12
|
+
2. You may modify your copy of the software in any way, provided that
|
13
|
+
you do at least ONE of the following:
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
a. place your modifications in the Public Domain or otherwise
|
16
|
+
make them Freely Available, such as by posting said
|
17
|
+
modifications to Usenet or an equivalent medium, or by allowing
|
18
|
+
the author to include your modifications in the software.
|
19
19
|
|
20
|
-
|
21
|
-
|
20
|
+
b. use the modified software only within your corporation or
|
21
|
+
organization.
|
22
22
|
|
23
|
-
|
24
|
-
|
23
|
+
c. give non-standard binaries non-standard names, with
|
24
|
+
instructions on where to get the original software distribution.
|
25
25
|
|
26
|
-
|
26
|
+
d. make other distribution arrangements with the author.
|
27
27
|
|
28
|
-
|
29
|
-
|
28
|
+
3. You may distribute the software in object code or binary form,
|
29
|
+
provided that you do at least ONE of the following:
|
30
30
|
|
31
|
-
|
32
|
-
|
33
|
-
|
31
|
+
a. distribute the binaries and library files of the software,
|
32
|
+
together with instructions (in the manual page or equivalent)
|
33
|
+
on where to get the original distribution.
|
34
34
|
|
35
|
-
|
36
|
-
|
35
|
+
b. accompany the distribution with the machine-readable source of
|
36
|
+
the software.
|
37
37
|
|
38
|
-
|
39
|
-
|
38
|
+
c. give non-standard binaries non-standard names, with
|
39
|
+
instructions on where to get the original software distribution.
|
40
40
|
|
41
|
-
|
41
|
+
d. make other distribution arrangements with the author.
|
42
42
|
|
43
|
-
|
44
|
-
|
45
|
-
|
43
|
+
4. You may modify and include the part of the software into any other
|
44
|
+
software (possibly commercial). But some files in the distribution
|
45
|
+
are not written by the author, so that they are not under these terms.
|
46
46
|
|
47
|
-
|
48
|
-
|
47
|
+
For the list of those files and their copying conditions, see the
|
48
|
+
file LEGAL.
|
49
49
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
50
|
+
5. The scripts and library files supplied as input to or produced as
|
51
|
+
output from the software do not automatically fall under the
|
52
|
+
copyright of the software, but belong to whomever generated them,
|
53
|
+
and may be sold commercially, and may be aggregated with this
|
54
|
+
software.
|
55
55
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
56
|
+
6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
|
57
|
+
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
58
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
59
|
+
PURPOSE.
|
60
60
|
|
61
61
|
Exceptions
|
62
62
|
----------
|
63
63
|
|
64
|
-
* lib/test/unit/diff.rb: This license
|
65
|
-
or later
|
66
|
-
|
67
|
-
* lib/test-unit.rb: This license and/or LGPLv2.1 or later
|
64
|
+
* lib/test/unit/diff.rb: This license and PSF license
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# test-unit
|
2
2
|
|
3
|
-
[](http://badge.fury.io/rb/test-unit)
|
4
|
+
[](https://github.com/test-unit/test-unit/actions/workflows/test.yml?query=branch%3Amaster+)
|
5
5
|
|
6
6
|
* http://test-unit.github.io/
|
7
7
|
* https://github.com/test-unit/test-unit
|
@@ -15,6 +15,17 @@ principles. These were originally designed by Kent Beck, creator of extreme
|
|
15
15
|
programming software development methodology, for Smalltalk's SUnit. It allows
|
16
16
|
writing tests, checking results and automated testing in Ruby.
|
17
17
|
|
18
|
+
test-unit ships as part of Ruby as a bundled gem. To check which version is included, see https://stdgems.org/test-unit/.
|
19
|
+
It's only necessary to install the gem if you need a newer version.
|
20
|
+
|
21
|
+
test-unit is the original Ruby unit testing library, and is still active.
|
22
|
+
It is one of two unit testing libraries bundled with Ruby, the other being [minitest](https://github.com/seattlerb/minitest).
|
23
|
+
|
24
|
+
When deciding which to use, consider:
|
25
|
+
|
26
|
+
* test-unit is strict about backwards compatibility. A backwards-incompatible change would be considered a bug.
|
27
|
+
* test-unit aims to support old Ruby versions, even if EOL.
|
28
|
+
|
18
29
|
## Features
|
19
30
|
|
20
31
|
* test-unit 1.2.3 is the original test-unit, taken
|
@@ -24,7 +35,7 @@ writing tests, checking results and automated testing in Ruby.
|
|
24
35
|
to radically change very soon).
|
25
36
|
|
26
37
|
* test-unit will be improved actively and may break
|
27
|
-
|
38
|
+
compatibility with test-unit 1.2.3. (We will not hope it
|
28
39
|
if it isn't needed.)
|
29
40
|
|
30
41
|
* Some features exist as separated gems like GUI test
|
@@ -51,17 +62,13 @@ If you want to use full test-unit features:
|
|
51
62
|
|
52
63
|
## License
|
53
64
|
|
54
|
-
|
55
|
-
|
56
|
-
This software is distributed under the same terms as ruby.
|
65
|
+
This software is distributed under either the terms of new Ruby
|
66
|
+
License or BSDL. See the file [COPYING](COPYING).
|
57
67
|
|
58
68
|
Exception:
|
59
69
|
|
60
|
-
* lib/test/unit/diff.rb is a triple license of the Ruby license
|
61
|
-
|
62
|
-
|
63
|
-
* lib/test-unit.rb is a dual license of the Ruby license and LGPLv2.1
|
64
|
-
or later.
|
70
|
+
* lib/test/unit/diff.rb is a triple license of (the new Ruby license
|
71
|
+
or BSDL) and PSF license.
|
65
72
|
|
66
73
|
## Authors
|
67
74
|
|
data/Rakefile
CHANGED
@@ -1,20 +1,6 @@
|
|
1
1
|
# -*- ruby -*-
|
2
2
|
#
|
3
3
|
# Copyright (C) 2008-2017 Kouhei Sutou <kou@clear-code.com>
|
4
|
-
#
|
5
|
-
# This library is free software; you can redistribute it and/or
|
6
|
-
# modify it under the terms of the GNU Lesser General Public
|
7
|
-
# License as published by the Free Software Foundation; either
|
8
|
-
# version 2.1 of the License, or (at your option) any later version.
|
9
|
-
#
|
10
|
-
# This library is distributed in the hope that it will be useful,
|
11
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
-
# Lesser General Public License for more details.
|
14
|
-
#
|
15
|
-
# You should have received a copy of the GNU Lesser General Public
|
16
|
-
# License along with this library; if not, write to the Free Software
|
17
|
-
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
18
4
|
|
19
5
|
Encoding.default_internal = "UTF-8" if defined?(Encoding.default_internal)
|
20
6
|
|
@@ -38,7 +24,6 @@ require "packnga"
|
|
38
24
|
task :default => :test
|
39
25
|
|
40
26
|
base_dir = File.dirname(__FILE__)
|
41
|
-
html_base_dir = File.join(base_dir, "doc", "html")
|
42
27
|
|
43
28
|
helper = Bundler::GemHelper.new(base_dir)
|
44
29
|
def helper.version_tag
|
@@ -67,14 +52,6 @@ def rake(*arguments)
|
|
67
52
|
ruby($0, *arguments)
|
68
53
|
end
|
69
54
|
|
70
|
-
namespace :html do
|
71
|
-
desc "Publish HTML to Web site."
|
72
|
-
task :publish do
|
73
|
-
# FIXME Do nothing for now
|
74
|
-
#rsync_to_rubyforge(spec, "#{html_base_dir}/", "")
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
55
|
task :test do
|
79
56
|
ruby("test/run-test.rb")
|
80
57
|
end
|
data/doc/text/getting-started.md
CHANGED
@@ -239,8 +239,8 @@ module Sub
|
|
239
239
|
end
|
240
240
|
~~~
|
241
241
|
|
242
|
-
## 7. For more
|
242
|
+
## 7. For more information
|
243
243
|
|
244
244
|
Let's read the official document.
|
245
245
|
|
246
|
-
* [test-unit](
|
246
|
+
* [test-unit](https://test-unit.github.io/index.html)
|
data/doc/text/news.md
CHANGED
@@ -1,5 +1,333 @@
|
|
1
1
|
# News
|
2
2
|
|
3
|
+
## 3.5.5 - 2022-10-04 {#version-3-5-5}
|
4
|
+
|
5
|
+
### Fixes
|
6
|
+
|
7
|
+
* Suppressed a warning.
|
8
|
+
[GitHub#219][Patch by Kenichi Kamiya]
|
9
|
+
|
10
|
+
### Thanks
|
11
|
+
|
12
|
+
* Kenichi Kamiya
|
13
|
+
|
14
|
+
## 3.5.4 - 2022-10-04 {#version-3-5-4}
|
15
|
+
|
16
|
+
### Improvements
|
17
|
+
|
18
|
+
* Don't raise an error on `Test::Unit::TestCase.clone`.
|
19
|
+
[GitHub#210][Reported by David Marchaland]
|
20
|
+
|
21
|
+
* Added support for `BigDeciaml` in `assert_in_delta` family.
|
22
|
+
[GitHub#218][Patch by Kenta Murata]
|
23
|
+
|
24
|
+
### Thanks
|
25
|
+
|
26
|
+
* David Marchaland
|
27
|
+
|
28
|
+
* Kenta Murata
|
29
|
+
|
30
|
+
## 3.5.3 - 2021-12-20 {#version-3-5-3}
|
31
|
+
|
32
|
+
### Improvements
|
33
|
+
|
34
|
+
* Made how to sub test case generation customizable.
|
35
|
+
[GitHub#207][Patch by Akira Matsuda]
|
36
|
+
|
37
|
+
### Thanks
|
38
|
+
|
39
|
+
* Akira Matsuda
|
40
|
+
|
41
|
+
## 3.5.2 - 2021-12-10 {#version-3-5-2}
|
42
|
+
|
43
|
+
### Improvements
|
44
|
+
|
45
|
+
* Required `fileutils` lazy.
|
46
|
+
[GitHub#206][Patch by David Rodríguez]
|
47
|
+
|
48
|
+
### Thanks
|
49
|
+
|
50
|
+
* David Rodríguez
|
51
|
+
|
52
|
+
## 3.5.1 - 2021-11-08 {#version-3-5-1}
|
53
|
+
|
54
|
+
### Fixes
|
55
|
+
|
56
|
+
* Fixed a bug that `keep: true` is ignored when data set is
|
57
|
+
generated by block. [Reported by Kenta Murata]
|
58
|
+
|
59
|
+
### Thanks
|
60
|
+
|
61
|
+
* Kenta Murata
|
62
|
+
|
63
|
+
## 3.5.0 - 2021-10-18 {#version-3-5-0}
|
64
|
+
|
65
|
+
### Fixes
|
66
|
+
|
67
|
+
* Fixed a bug that `keep: true` is ignored when the last `data`
|
68
|
+
doesn't have `keep: true`.
|
69
|
+
|
70
|
+
## 3.4.9 - 2021-10-18 {#version-3-4-9}
|
71
|
+
|
72
|
+
### Improvements
|
73
|
+
|
74
|
+
* Added support for labeling each variable values by using `Hash`.
|
75
|
+
|
76
|
+
## 3.4.8 - 2021-10-11 {#version-3-4-8}
|
77
|
+
|
78
|
+
### Improvements
|
79
|
+
|
80
|
+
* Added support for omitting Ractor tests on Ruby 2.7 or earlier
|
81
|
+
automatically.
|
82
|
+
|
83
|
+
## 3.4.7 - 2021-09-14 {#version-3-4-7}
|
84
|
+
|
85
|
+
### Fixes
|
86
|
+
|
87
|
+
* Suppressed a warning on Ruby 2.
|
88
|
+
[GitHub#205][Patch by Kenichi Kamiya]
|
89
|
+
|
90
|
+
### Thanks
|
91
|
+
|
92
|
+
* Kenichi Kamiya
|
93
|
+
|
94
|
+
## 3.4.6 - 2021-09-11 {#version-3-4-6}
|
95
|
+
|
96
|
+
### Improvements
|
97
|
+
|
98
|
+
* Added support for tests that use Ractor. Use
|
99
|
+
`Test::Unit::TestCase.ractor` to declare that these tests use
|
100
|
+
Ractor.
|
101
|
+
|
102
|
+
* Added `--debug-on-failure` option.
|
103
|
+
|
104
|
+
## 3.4.5 - 2021-09-04 {#version-3-4-5}
|
105
|
+
|
106
|
+
### Improvements
|
107
|
+
|
108
|
+
* Added more metadata to gemspec.
|
109
|
+
[GitHub#183][Patch by Kenichi Kamiya]
|
110
|
+
|
111
|
+
* Removed needless files from gem.
|
112
|
+
[GitHub#184][Patch by Kenichi Kamiya]
|
113
|
+
|
114
|
+
* Updated documents.
|
115
|
+
[GitHub#191][GitHub#192][GitHub#193][GitHub#199][GitHub#200]
|
116
|
+
[GitHub#201][Patch by Kenichi Kamiya]
|
117
|
+
|
118
|
+
* Added `assert_nothing_leaked_memory`.
|
119
|
+
|
120
|
+
### Fixes
|
121
|
+
|
122
|
+
* Fixed typos in documents.
|
123
|
+
[GitHub#189][GitHub#190][GitHub#195][GitHub#197][Patch by Kenichi Kamiya]
|
124
|
+
|
125
|
+
### Thanks
|
126
|
+
|
127
|
+
* Kenichi Kamiya
|
128
|
+
|
129
|
+
## 3.4.4 - 2021-06-04 {#version-3-4-4}
|
130
|
+
|
131
|
+
### Improvements
|
132
|
+
|
133
|
+
* Renamed `assert_all?` to `assert_all`. `assert_all?` is deprecated
|
134
|
+
but is available.
|
135
|
+
|
136
|
+
## 3.4.3 - 2021-06-04 {#version-3-4-3}
|
137
|
+
|
138
|
+
### Improvements
|
139
|
+
|
140
|
+
* Stopped to change result value of `Test::Unit::TestCase#include`.
|
141
|
+
|
142
|
+
* Added `assert_all?`.
|
143
|
+
|
144
|
+
* Added support for `assert_raise_with_message`.
|
145
|
+
|
146
|
+
## 3.4.2 - 2021-05-30 {#version-3-4-2}
|
147
|
+
|
148
|
+
### Improvements
|
149
|
+
|
150
|
+
* [UI][console]: Improved diff readability for no color
|
151
|
+
case. Character based diff marks are always showed.
|
152
|
+
|
153
|
+
## 3.4.1 - 2021-04-19 {#version-3-4-1}
|
154
|
+
|
155
|
+
### Fixes
|
156
|
+
|
157
|
+
* Fixed a bug that `setup`/`cleanup`/`teardown` with block may be
|
158
|
+
overwritten by another `setup`/`cleanup`/`teardown` with
|
159
|
+
block. It's caused only with Ruby 2.6 or earlier.
|
160
|
+
[GitHub#179][Reported by akira yamada]
|
161
|
+
|
162
|
+
### Thanks
|
163
|
+
|
164
|
+
* akira yamada
|
165
|
+
|
166
|
+
## 3.4.0 - 2021-01-30 {#version-3-4-0}
|
167
|
+
|
168
|
+
### Improvements
|
169
|
+
|
170
|
+
* Enable deprecated warnings by default.
|
171
|
+
|
172
|
+
## 3.3.9 - 2020-12-29 {#version-3-3-9}
|
173
|
+
|
174
|
+
### Improvements
|
175
|
+
|
176
|
+
* `assert_not_match`: Add support for `String` as pattern.
|
177
|
+
[GitHub#178][Patch by David Rodríguez]
|
178
|
+
|
179
|
+
### Thanks
|
180
|
+
|
181
|
+
* David Rodríguez
|
182
|
+
|
183
|
+
## 3.3.8 - 2020-12-25 {#version-3-3-8}
|
184
|
+
|
185
|
+
### Improvements
|
186
|
+
|
187
|
+
* [UI][console]: Removed reverse mode because Ruby 3.0 reverts
|
188
|
+
reverse backtrace.
|
189
|
+
|
190
|
+
## 3.3.7 - 2020-11-18 {#version-3-3-7}
|
191
|
+
|
192
|
+
### Improvements
|
193
|
+
|
194
|
+
* Improved TruffleRuby support.
|
195
|
+
[GitHub#171][Reported by Benoit Daloze]
|
196
|
+
|
197
|
+
* Removed needless `to_sym`.
|
198
|
+
[GitHub#177][Patch by icm7216]
|
199
|
+
|
200
|
+
* `assert_raise`: Added backtrace for actual error.
|
201
|
+
|
202
|
+
* Improved terminal color availability detection.
|
203
|
+
[GitHub#175][Patch by nicholas a. evans]
|
204
|
+
|
205
|
+
* Changed license to the new Ruby's.
|
206
|
+
[GitHub#174]
|
207
|
+
|
208
|
+
### Fixes
|
209
|
+
|
210
|
+
* Fixed a typo in `--help` output:
|
211
|
+
[GitHub#176][Patch by icm7216]
|
212
|
+
|
213
|
+
### Thanks
|
214
|
+
|
215
|
+
* Benoit Daloze
|
216
|
+
|
217
|
+
* icm7216
|
218
|
+
|
219
|
+
* nicholas a. evans
|
220
|
+
|
221
|
+
## 3.3.6 - 2020-06-10 {#version-3-3-6}
|
222
|
+
|
223
|
+
### Improvements
|
224
|
+
|
225
|
+
* `name`, `--ignore-name`:
|
226
|
+
|
227
|
+
* Added support for regular expression options.
|
228
|
+
|
229
|
+
* Added support for matching with class name in exact match mode.
|
230
|
+
[Reported by Jun Aruga]
|
231
|
+
|
232
|
+
* Updated ruby-talk mailing list information
|
233
|
+
[GitHub#168][Patch by Chris Kampmeier]
|
234
|
+
|
235
|
+
### Thanks
|
236
|
+
|
237
|
+
* Chris Kampmeier
|
238
|
+
|
239
|
+
* Jun Aruga
|
240
|
+
|
241
|
+
## 3.3.5 - 2020-01-10 {#version-3-3-5}
|
242
|
+
|
243
|
+
### Improvements
|
244
|
+
|
245
|
+
* Improved code snippet showing with different default external encoding.
|
246
|
+
[GitHub#166][Patch by Yuta Iwama]
|
247
|
+
|
248
|
+
### Thanks
|
249
|
+
|
250
|
+
* Yuta Iwama
|
251
|
+
|
252
|
+
## 3.3.4 - 2019-09-30 {#version-3-3-4}
|
253
|
+
|
254
|
+
### Improvements
|
255
|
+
|
256
|
+
* Converted markup format to Markdown from RDoc.
|
257
|
+
[GitHub#164][Patch by OGAWA KenIchi]
|
258
|
+
|
259
|
+
* test: Stopped to depend on `Time#inspect` format.
|
260
|
+
[GitHub#165][Reported by Benoit Daloze]
|
261
|
+
|
262
|
+
### Thanks
|
263
|
+
|
264
|
+
* OGAWA KenIchi
|
265
|
+
|
266
|
+
* Benoit Daloze
|
267
|
+
|
268
|
+
## 3.3.3 - 2019-05-10 {#version-3-3-3}
|
269
|
+
|
270
|
+
### Fixed
|
271
|
+
|
272
|
+
* Fixed a bug that priority mode with test case name that uses
|
273
|
+
special characters such as `?` can't be used on Windows.
|
274
|
+
|
275
|
+
## 3.3.2 - 2019-04-11 {#version-3-3-2}
|
276
|
+
|
277
|
+
### Fixes
|
278
|
+
|
279
|
+
* Fixed a bug that `Test::Unit::Collector::Load` doesn't load test
|
280
|
+
files under sub directories when these files have the same base
|
281
|
+
name as test files in upper directories.
|
282
|
+
[Reported by Kenta Murata]
|
283
|
+
|
284
|
+
### Thanks
|
285
|
+
|
286
|
+
* Kenta Murata
|
287
|
+
|
288
|
+
## 3.3.1 - 2019-03-27 {#version-3-3-1}
|
289
|
+
|
290
|
+
### Improvements
|
291
|
+
|
292
|
+
* Added support for `Test::Unit::AssertionFailedError#user_message`
|
293
|
+
for not only `assert_equal` and `assert_raise` but also all
|
294
|
+
assertions.
|
295
|
+
[GitHub#162][Reported by xgraffm]
|
296
|
+
|
297
|
+
### Thanks
|
298
|
+
|
299
|
+
* xgraffm
|
300
|
+
|
301
|
+
## 3.3.0 - 2019-01-23 {#version-3-3-0}
|
302
|
+
|
303
|
+
### Improvements
|
304
|
+
|
305
|
+
* Added support for auto test run when all tests are defined in
|
306
|
+
modules.
|
307
|
+
|
308
|
+
* Added support for defining methods to test case class in multiple
|
309
|
+
threads.
|
310
|
+
[GitHub#159][Reported by Charles Oliver Nutter]
|
311
|
+
|
312
|
+
* Suppressed warnings on Ruby 2.5.
|
313
|
+
[GitHub#160][Reported by Daniel Berger]
|
314
|
+
|
315
|
+
* Suppressed warnings on Ruby 2.7.
|
316
|
+
|
317
|
+
### Fixes
|
318
|
+
|
319
|
+
* Fixed a code snippet fetch failure when source code isn't UTF-8
|
320
|
+
and the default external encoding is set to not UTF-8.
|
321
|
+
[GitHub#161][Reported by masa kunikata]
|
322
|
+
|
323
|
+
### Thanks
|
324
|
+
|
325
|
+
* Charles Oliver Nutter
|
326
|
+
|
327
|
+
* Daniel Berger
|
328
|
+
|
329
|
+
* masa kunikata
|
330
|
+
|
3
331
|
## 3.2.9 - 2018-12-01 {#version-3-2-9}
|
4
332
|
|
5
333
|
### Improvements
|
@@ -1249,7 +1577,7 @@ Output improvement release!
|
|
1249
1577
|
* use ~/.test-unit.yml as global configuration file.
|
1250
1578
|
* add TAP runner. (--runner tap)
|
1251
1579
|
* support colorized diff:
|
1252
|
-
|
1580
|
+
https://test-unit.github.io/color-diff.png
|
1253
1581
|
* add Test::Unit::AutoRunner.default_runner= to specify default test runner.
|
1254
1582
|
|
1255
1583
|
* 4 minor enhancements
|
@@ -9,6 +9,17 @@ module Test
|
|
9
9
|
|
10
10
|
# Thrown by Test::Unit::Assertions when an assertion fails.
|
11
11
|
class AssertionFailedError < StandardError
|
12
|
+
@debug_on_failure = false
|
13
|
+
class << self
|
14
|
+
def debug_on_failure=(boolean)
|
15
|
+
@debug_on_failure = boolean
|
16
|
+
end
|
17
|
+
|
18
|
+
def debug_on_failure?
|
19
|
+
@debug_on_failure
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
12
23
|
attr_accessor :expected, :actual, :user_message
|
13
24
|
attr_accessor :inspected_expected, :inspected_actual
|
14
25
|
def initialize(message=nil, options=nil)
|
@@ -19,6 +30,30 @@ module Test
|
|
19
30
|
@inspected_actual = options[:inspected_actual]
|
20
31
|
@user_message = options[:user_message]
|
21
32
|
super(message)
|
33
|
+
debug_on_failure
|
34
|
+
end
|
35
|
+
|
36
|
+
private
|
37
|
+
def debug_on_failure
|
38
|
+
return unless self.class.debug_on_failure?
|
39
|
+
|
40
|
+
begin
|
41
|
+
require "debug"
|
42
|
+
rescue LoadError
|
43
|
+
return
|
44
|
+
end
|
45
|
+
|
46
|
+
return unless binding.respond_to?(:break)
|
47
|
+
|
48
|
+
frames = caller(0)
|
49
|
+
pre = nil
|
50
|
+
Util::BacktraceFilter.filter_backtrace(frames).each do |location|
|
51
|
+
frame_index = frames.index(location)
|
52
|
+
next if frame_index.nil?
|
53
|
+
pre = "frame #{frame_index}"
|
54
|
+
break
|
55
|
+
end
|
56
|
+
binding.break(pre: pre)
|
22
57
|
end
|
23
58
|
end
|
24
59
|
end
|