test-unit 3.2.0 → 3.3.6
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 +5 -5
- data/COPYING +4 -1
- data/README.md +11 -11
- data/Rakefile +10 -1
- data/doc/text/getting-started.md +246 -0
- data/doc/text/news.md +372 -1
- data/lib/test/unit.rb +171 -157
- data/lib/test/unit/assertions.rb +187 -149
- data/lib/test/unit/attribute.rb +71 -2
- data/lib/test/unit/autorunner.rb +65 -32
- data/lib/test/unit/code-snippet-fetcher.rb +7 -7
- data/lib/test/unit/collector/load.rb +8 -13
- data/lib/test/unit/data-sets.rb +116 -0
- data/lib/test/unit/data.rb +121 -12
- data/lib/test/unit/diff.rb +11 -11
- data/lib/test/unit/fixture.rb +3 -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 -3
- data/lib/test/unit/runner/console.rb +25 -0
- data/lib/test/unit/test-suite-creator.rb +22 -8
- data/lib/test/unit/testcase.rb +270 -182
- data/lib/test/unit/ui/console/testrunner.rb +90 -35
- data/lib/test/unit/ui/emacs/testrunner.rb +5 -5
- data/lib/test/unit/util/observable.rb +2 -2
- data/lib/test/unit/util/output.rb +5 -4
- data/lib/test/unit/util/procwrapper.rb +4 -4
- data/lib/test/unit/version.rb +1 -1
- data/test/collector/test-descendant.rb +4 -0
- data/test/collector/test-load.rb +35 -2
- data/test/collector/test_dir.rb +5 -4
- data/test/collector/test_objectspace.rb +7 -5
- data/test/test-assertions.rb +128 -101
- data/test/test-code-snippet.rb +42 -0
- data/test/test-data.rb +195 -79
- data/test/test-priority.rb +19 -8
- data/test/test-test-case.rb +111 -3
- data/test/test-test-suite.rb +1 -0
- data/test/testunit-test-util.rb +2 -0
- metadata +38 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: b7aaedb309f50feea0367554eeef8b79f0daf6edb5c75c4b66df9e990c35d371
|
4
|
+
data.tar.gz: 17bd1f32e290087d6b57cf5337dbd8cc8259896671ef1cc6c23b15579e52698b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d86d52e5ed5bc4930f6b26f76d0294cb2e50261f16495649e75eb79ab2631cd23c2bfd6602ede230384f3971e9f780f87a8324ca15a0b3a09866a1c449641e55
|
7
|
+
data.tar.gz: 26975998cc3e8c4c6e5d372b3d3e51316e2709508fdb5ebd87083dcf658941f4b038bcc4f6e1f714ba891a14c1ccbca5ec5e197065a45163dcfd5861cd5b6c15
|
data/COPYING
CHANGED
@@ -61,4 +61,7 @@ version 2 (see the file GPL), or the conditions below:
|
|
61
61
|
Exceptions
|
62
62
|
----------
|
63
63
|
|
64
|
-
* lib/test/unit/diff.rb:
|
64
|
+
* lib/test/unit/diff.rb: This license, PSF license and/or LGPLv2.1
|
65
|
+
or later
|
66
|
+
|
67
|
+
* lib/test-unit.rb: This license and/or LGPLv2.1 or later
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# test-unit
|
2
2
|
|
3
|
-
[](http://badge.fury.io/rb/test-unit)
|
4
|
+
[](https://travis-ci.org/test-unit/test-unit)
|
5
5
|
|
6
6
|
* http://test-unit.github.io/
|
7
7
|
* https://github.com/test-unit/test-unit
|
@@ -10,31 +10,31 @@
|
|
10
10
|
|
11
11
|
An xUnit family unit testing framework for Ruby.
|
12
12
|
|
13
|
-
Test::Unit
|
13
|
+
test-unit (Test::Unit) is unit testing framework for Ruby, based on xUnit
|
14
14
|
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
18
|
## Features
|
19
19
|
|
20
|
-
*
|
20
|
+
* test-unit 1.2.3 is the original test-unit, taken
|
21
21
|
straight from the ruby distribution. It is being
|
22
22
|
distributed as a gem to allow tool builders to use it as a
|
23
23
|
stand-alone package. (The test framework in ruby is going
|
24
24
|
to radically change very soon).
|
25
25
|
|
26
26
|
* test-unit will be improved actively and may break
|
27
|
-
compatiblity with
|
27
|
+
compatiblity with test-unit 1.2.3. (We will not hope it
|
28
28
|
if it isn't needed.)
|
29
29
|
|
30
30
|
* Some features exist as separated gems like GUI test
|
31
31
|
runner. (Tk, GTK+ and Fox) test-unit-full gem package
|
32
|
-
provides for installing all
|
32
|
+
provides for installing all test-unit related gems
|
33
33
|
easily.
|
34
34
|
|
35
35
|
## How To
|
36
36
|
|
37
|
-
* [How To](doc/text/how-to.md) (link for GitHub)
|
37
|
+
* [How To](https://github.com/test-unit/test-unit/blob/master/doc/text/how-to.md) (link for GitHub)
|
38
38
|
* {file:doc/text/how-to.md How To} (link for YARD)
|
39
39
|
|
40
40
|
## Install
|
@@ -43,7 +43,7 @@ writing tests, checking results and automated testing in Ruby.
|
|
43
43
|
% sudo gem install test-unit
|
44
44
|
</pre>
|
45
45
|
|
46
|
-
If you want to use full
|
46
|
+
If you want to use full test-unit features:
|
47
47
|
|
48
48
|
<pre>
|
49
49
|
% sudo gem install test-unit-full
|
@@ -57,8 +57,8 @@ This software is distributed under the same terms as ruby.
|
|
57
57
|
|
58
58
|
Exception:
|
59
59
|
|
60
|
-
* lib/test/unit/diff.rb is a
|
61
|
-
PSF license.
|
60
|
+
* lib/test/unit/diff.rb is a triple license of the Ruby license,
|
61
|
+
PSF license and LGPLv2.1 or later.
|
62
62
|
|
63
63
|
* lib/test-unit.rb is a dual license of the Ruby license and LGPLv2.1
|
64
64
|
or later.
|
@@ -77,7 +77,7 @@ Exception:
|
|
77
77
|
|
78
78
|
### Images
|
79
79
|
|
80
|
-
* Mayu & Co.: kinotan icons
|
80
|
+
* Mayu & Co.: kinotan icons
|
81
81
|
|
82
82
|
## Thanks
|
83
83
|
|
data/Rakefile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- ruby -*-
|
2
2
|
#
|
3
|
-
# Copyright (C) 2008-
|
3
|
+
# Copyright (C) 2008-2017 Kouhei Sutou <kou@clear-code.com>
|
4
4
|
#
|
5
5
|
# This library is free software; you can redistribute it and/or
|
6
6
|
# modify it under the terms of the GNU Lesser General Public
|
@@ -18,6 +18,15 @@
|
|
18
18
|
|
19
19
|
Encoding.default_internal = "UTF-8" if defined?(Encoding.default_internal)
|
20
20
|
|
21
|
+
# TODO: Remove me when we drop Ruby 1.9 support.
|
22
|
+
unless "".respond_to?(:b)
|
23
|
+
class String
|
24
|
+
def b
|
25
|
+
dup.force_encoding("ASCII-8BIT")
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
21
30
|
require "erb"
|
22
31
|
require "yaml"
|
23
32
|
require "rubygems"
|
@@ -0,0 +1,246 @@
|
|
1
|
+
## 1. First step of the `test-unit`
|
2
|
+
|
3
|
+
Let's getting start `test-unit`.
|
4
|
+
|
5
|
+
This document creates an example gem package called `sample` with the `test-unit` testing framework.
|
6
|
+
|
7
|
+
## 2. Install bundler and test-unit.
|
8
|
+
|
9
|
+
* First, install the `bundler` gem for generating gem template.
|
10
|
+
* Second, install the `test-unit` itself.
|
11
|
+
|
12
|
+
~~~
|
13
|
+
!!!plain
|
14
|
+
gem install bundler
|
15
|
+
gem install test-unit
|
16
|
+
~~~
|
17
|
+
|
18
|
+
The `gem list` command output installed packages.
|
19
|
+
You will find the following lines.
|
20
|
+
|
21
|
+
~~~
|
22
|
+
!!!plain
|
23
|
+
gem list
|
24
|
+
...
|
25
|
+
bundler (1.14.6)
|
26
|
+
...
|
27
|
+
test-unit (3.2.3)
|
28
|
+
~~~
|
29
|
+
|
30
|
+
## 3. Create gem template.
|
31
|
+
|
32
|
+
Next, create a gem template using `bundler` command.
|
33
|
+
This command generates package skeleton with a testing framework.
|
34
|
+
However, this command can't generate test templates for `test-unit`.
|
35
|
+
|
36
|
+
So, First create gem template with the `minitest` testing framework.
|
37
|
+
(It's similar to `unit-test`).
|
38
|
+
After that, replace some files for `test-unit`.
|
39
|
+
|
40
|
+
The `bundle gem -t minitest sample` command will generate the following files.
|
41
|
+
|
42
|
+
~~~
|
43
|
+
!!!plain
|
44
|
+
.
|
45
|
+
|-- Gemfile
|
46
|
+
|-- README.md
|
47
|
+
|-- Rakefile
|
48
|
+
|-- bin
|
49
|
+
| |-- console
|
50
|
+
| `-- setup
|
51
|
+
|-- lib
|
52
|
+
| |-- sample
|
53
|
+
| | `-- version.rb
|
54
|
+
| `-- sample.rb
|
55
|
+
|-- sample.gemspec # <- Modify
|
56
|
+
`-- test
|
57
|
+
|-- sample_test.rb # <- Modify
|
58
|
+
`-- test_helper.rb # <- Modify
|
59
|
+
~~~
|
60
|
+
|
61
|
+
## 4. Edit files for `test-unit`
|
62
|
+
|
63
|
+
### 4.1. Edit gemspec
|
64
|
+
|
65
|
+
Edit `sample.gemspec` like the below.
|
66
|
+
Replace `minitest` line to `test-unit`.
|
67
|
+
|
68
|
+
Before
|
69
|
+
|
70
|
+
~~~
|
71
|
+
!!!ruby
|
72
|
+
spec.add_development_dependency "minitest", "~> 5.0"
|
73
|
+
~~~
|
74
|
+
|
75
|
+
After
|
76
|
+
|
77
|
+
~~~
|
78
|
+
!!!ruby
|
79
|
+
spec.add_development_dependency "test-unit", "~> 3.2.3"
|
80
|
+
~~~
|
81
|
+
|
82
|
+
### 4.2. Edit `test/test_helper.rb`
|
83
|
+
|
84
|
+
Next, edit the `test/test_helper.rb` file.
|
85
|
+
|
86
|
+
Before
|
87
|
+
|
88
|
+
~~~
|
89
|
+
!!!ruby
|
90
|
+
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
|
91
|
+
require 'sample'
|
92
|
+
|
93
|
+
require 'minitest/autorun' # <-- Modify this line.
|
94
|
+
~~~
|
95
|
+
|
96
|
+
After
|
97
|
+
|
98
|
+
~~~
|
99
|
+
!!!ruby
|
100
|
+
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
|
101
|
+
require 'sample'
|
102
|
+
|
103
|
+
require 'test/unit' # <-- After modification.
|
104
|
+
~~~
|
105
|
+
|
106
|
+
### 4.3 Rakefile (No edit)
|
107
|
+
|
108
|
+
This file doesn't need to modify.
|
109
|
+
The output is the below.
|
110
|
+
|
111
|
+
~~~
|
112
|
+
!!!ruby
|
113
|
+
require "bundler/gem_tasks"
|
114
|
+
require "rake/testtask"
|
115
|
+
|
116
|
+
Rake::TestTask.new(:test) do |t|
|
117
|
+
t.libs << "test"
|
118
|
+
t.libs << "lib"
|
119
|
+
t.test_files = FileList['test/**/*_test.rb']
|
120
|
+
end
|
121
|
+
|
122
|
+
task :default => :test
|
123
|
+
~~~
|
124
|
+
|
125
|
+
### 4.4 Edit `test/sample_test.rb`
|
126
|
+
|
127
|
+
The bundler generate the file `test/sample_test.rb`.
|
128
|
+
This file originally templates for `minitest`.
|
129
|
+
|
130
|
+
Let's modify this file for `test-unit`
|
131
|
+
|
132
|
+
before
|
133
|
+
|
134
|
+
~~~
|
135
|
+
!!!ruby
|
136
|
+
require 'test_helper'
|
137
|
+
|
138
|
+
class SampleTest < Minitest::Test # <- Modify here
|
139
|
+
def test_that_it_has_a_version_number
|
140
|
+
refute_nil ::Sample::VERSION
|
141
|
+
end
|
142
|
+
|
143
|
+
def test_it_does_something_useful
|
144
|
+
assert false
|
145
|
+
end
|
146
|
+
end
|
147
|
+
~~~
|
148
|
+
|
149
|
+
After
|
150
|
+
|
151
|
+
~~~
|
152
|
+
!!!ruby
|
153
|
+
require 'test_helper'
|
154
|
+
|
155
|
+
class SampleTest < Test::Unit::TestCase # <- After modification
|
156
|
+
def test_that_it_has_a_version_number
|
157
|
+
refute_nil ::Sample::VERSION
|
158
|
+
end
|
159
|
+
|
160
|
+
def test_it_does_something_useful
|
161
|
+
assert false
|
162
|
+
end
|
163
|
+
end
|
164
|
+
~~~
|
165
|
+
|
166
|
+
## 5. Execute test.
|
167
|
+
|
168
|
+
The `rake test` command execute test scenarios in the `test` directory.
|
169
|
+
Now it tries to two tests. One will success the other one fails.
|
170
|
+
|
171
|
+
~~~
|
172
|
+
!!!plain
|
173
|
+
rake test
|
174
|
+
Loaded suite
|
175
|
+
/path/to/ruby/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/rake_test_loader
|
176
|
+
Started
|
177
|
+
F
|
178
|
+
================================================================================
|
179
|
+
Failure: <false> is not true.
|
180
|
+
test_it_does_something_useful(SampleTest)
|
181
|
+
/path/to/sample/test/sample_test.rb:9:in `test_it_does_something_useful'
|
182
|
+
6: end
|
183
|
+
7:
|
184
|
+
8: def test_it_does_something_useful
|
185
|
+
=> 9: assert false
|
186
|
+
10: end
|
187
|
+
11: end
|
188
|
+
================================================================================
|
189
|
+
.
|
190
|
+
|
191
|
+
Finished in 0.011521 seconds.
|
192
|
+
--------------------------------------------------------------------------------
|
193
|
+
2 tests, 2 assertions, 1 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
|
194
|
+
50% passed
|
195
|
+
--------------------------------------------------------------------------------
|
196
|
+
173.60 tests/s, 173.60 assertions/s
|
197
|
+
rake aborted!
|
198
|
+
Command failed with status (1)
|
199
|
+
|
200
|
+
Tasks: TOP => test
|
201
|
+
(See full trace by running task with --trace)
|
202
|
+
~~~
|
203
|
+
|
204
|
+
## 6. Create original tests.
|
205
|
+
|
206
|
+
Let's create your original tests with the following rules.
|
207
|
+
|
208
|
+
* Create a test file in the `test` directory.
|
209
|
+
* The file needs suffix `xxx_test.rb`.
|
210
|
+
* You can put test file into the subdirectory like `test/sub`.
|
211
|
+
|
212
|
+
Example directory layout.
|
213
|
+
|
214
|
+
~~~
|
215
|
+
!!!plain
|
216
|
+
test
|
217
|
+
|-- sample_test.rb
|
218
|
+
|-- sub
|
219
|
+
| `-- sample2_test.rb
|
220
|
+
`-- test_helper.rb
|
221
|
+
~~~
|
222
|
+
|
223
|
+
Example test file in the sub directory.
|
224
|
+
|
225
|
+
~~~
|
226
|
+
!!!ruby
|
227
|
+
require 'test_helper'
|
228
|
+
|
229
|
+
module Sub
|
230
|
+
class Sample2Test < Test::Unit::TestCase
|
231
|
+
def test_that_it_has_a_version_number
|
232
|
+
refute_nil ::Sample::VERSION
|
233
|
+
end
|
234
|
+
|
235
|
+
def test_it_does_something_useful
|
236
|
+
assert false
|
237
|
+
end
|
238
|
+
end
|
239
|
+
end
|
240
|
+
~~~
|
241
|
+
|
242
|
+
## 7. For more inforomation
|
243
|
+
|
244
|
+
Let's read the official document.
|
245
|
+
|
246
|
+
* [test-unit](http://test-unit.github.io/index.html)
|
data/doc/text/news.md
CHANGED
@@ -1,5 +1,376 @@
|
|
1
1
|
# News
|
2
2
|
|
3
|
+
## 3.3.6 - 2020-06-10 {#version-3-3-6}
|
4
|
+
|
5
|
+
### Improvements
|
6
|
+
|
7
|
+
* `name`, `--ignore-name`:
|
8
|
+
|
9
|
+
* Added support for regular expression options.
|
10
|
+
|
11
|
+
* Added support for matching with class name in exact match mode.
|
12
|
+
[Reported by Jun Aruga]
|
13
|
+
|
14
|
+
* Updated ruby-talk mailing list information
|
15
|
+
[GitHub#168][Patch by Chris Kampmeier]
|
16
|
+
|
17
|
+
### Thanks
|
18
|
+
|
19
|
+
* Chris Kampmeier
|
20
|
+
|
21
|
+
* Jun Aruga
|
22
|
+
|
23
|
+
## 3.3.5 - 2020-01-10 {#version-3-3-5}
|
24
|
+
|
25
|
+
### Improvements
|
26
|
+
|
27
|
+
* Improved code snippet showing with different default external encoding.
|
28
|
+
[GitHub#166][Patch by Yuta Iwama]
|
29
|
+
|
30
|
+
### Thanks
|
31
|
+
|
32
|
+
* Yuta Iwama
|
33
|
+
|
34
|
+
## 3.3.4 - 2019-09-30 {#version-3-3-4}
|
35
|
+
|
36
|
+
### Improvements
|
37
|
+
|
38
|
+
* Converted markup format to Markdown from RDoc.
|
39
|
+
[GitHub#164][Patch by OGAWA KenIchi]
|
40
|
+
|
41
|
+
* test: Stopped to depend on `Time#inspect` format.
|
42
|
+
[GitHub#165][Reported by Benoit Daloze]
|
43
|
+
|
44
|
+
### Thanks
|
45
|
+
|
46
|
+
* OGAWA KenIchi
|
47
|
+
|
48
|
+
* Benoit Daloze
|
49
|
+
|
50
|
+
## 3.3.3 - 2019-05-10 {#version-3-3-3}
|
51
|
+
|
52
|
+
### Fixed
|
53
|
+
|
54
|
+
* Fixed a bug that priority mode with test case name that uses
|
55
|
+
special characters such as `?` can't be used on Windows.
|
56
|
+
|
57
|
+
## 3.3.2 - 2019-04-11 {#version-3-3-2}
|
58
|
+
|
59
|
+
### Fixes
|
60
|
+
|
61
|
+
* Fixed a bug that `Test::Unit::Collector::Load` doesn't load test
|
62
|
+
files under sub directories when these files have the same base
|
63
|
+
name as test files in upper directories.
|
64
|
+
[Reported by Kenta Murata]
|
65
|
+
|
66
|
+
### Thanks
|
67
|
+
|
68
|
+
* Kenta Murata
|
69
|
+
|
70
|
+
## 3.3.1 - 2019-03-27 {#version-3-3-1}
|
71
|
+
|
72
|
+
### Improvements
|
73
|
+
|
74
|
+
* Added support for `Test::Unit::AssertionFailedError#user_message`
|
75
|
+
for not only `assert_equal` and `assert_raise` but also all
|
76
|
+
assertions.
|
77
|
+
[GitHub#162][Reported by xgraffm]
|
78
|
+
|
79
|
+
### Thanks
|
80
|
+
|
81
|
+
* xgraffm
|
82
|
+
|
83
|
+
## 3.3.0 - 2019-01-23 {#version-3-3-0}
|
84
|
+
|
85
|
+
### Improvements
|
86
|
+
|
87
|
+
* Added support for auto test run when all tests are defined in
|
88
|
+
modules.
|
89
|
+
|
90
|
+
* Added support for defining methods to test case class in multiple
|
91
|
+
threads.
|
92
|
+
[GitHub#159][Reported by Charles Oliver Nutter]
|
93
|
+
|
94
|
+
* Suppressed warnings on Ruby 2.5.
|
95
|
+
[GitHub#160][Reported by Daniel Berger]
|
96
|
+
|
97
|
+
* Suppressed warnings on Ruby 2.7.
|
98
|
+
|
99
|
+
### Fixes
|
100
|
+
|
101
|
+
* Fixed a code snippet fetch failure when source code isn't UTF-8
|
102
|
+
and the default external encoding is set to not UTF-8.
|
103
|
+
[GitHub#161][Reported by masa kunikata]
|
104
|
+
|
105
|
+
### Thanks
|
106
|
+
|
107
|
+
* Charles Oliver Nutter
|
108
|
+
|
109
|
+
* Daniel Berger
|
110
|
+
|
111
|
+
* masa kunikata
|
112
|
+
|
113
|
+
## 3.2.9 - 2018-12-01 {#version-3-2-9}
|
114
|
+
|
115
|
+
### Improvements
|
116
|
+
|
117
|
+
* Added support for data generation by method. `data_#{test_name}`
|
118
|
+
is called to generate data for `test_name` test.
|
119
|
+
|
120
|
+
* Added support for data matrix generation.
|
121
|
+
|
122
|
+
Example:
|
123
|
+
|
124
|
+
```ruby
|
125
|
+
data(:a, [0, 1, 2])
|
126
|
+
data(:b, [:x, :y])
|
127
|
+
def test_data(data)
|
128
|
+
end
|
129
|
+
```
|
130
|
+
|
131
|
+
This example generates the following data matrix:
|
132
|
+
|
133
|
+
* label: `"a: 0, b: :x"`, data: `{a: 0, b: :x}`
|
134
|
+
* label: `"a: 0, b: :y"`, data: `{a: 0, b: :y}`
|
135
|
+
* label: `"a: 1, b: :x"`, data: `{a: 1, b: :x}`
|
136
|
+
* label: `"a: 1, b: :y"`, data: `{a: 1, b: :y}`
|
137
|
+
* label: `"a: 2, b: :x"`, data: `{a: 2, b: :x}`
|
138
|
+
* label: `"a: 2, b: :y"`, data: `{a: 2, b: :y}`
|
139
|
+
|
140
|
+
* Added `Test::Unit::TestCase#data` that returns the current data.
|
141
|
+
|
142
|
+
* Added support for using test method that doesn't have no
|
143
|
+
parameters as data driven test.
|
144
|
+
|
145
|
+
Example:
|
146
|
+
|
147
|
+
```ruby
|
148
|
+
data("label", :value)
|
149
|
+
def test_data # Available since this release
|
150
|
+
p data # :value
|
151
|
+
end
|
152
|
+
```
|
153
|
+
|
154
|
+
* Added support for `:keep` option to `Test::Unit::TestCase.data`.
|
155
|
+
|
156
|
+
* Added support for `:group` option to
|
157
|
+
`Test::Unit::TestCase.data`. It's useful to generate multiple data
|
158
|
+
matrix groups.
|
159
|
+
|
160
|
+
```ruby
|
161
|
+
# Group1
|
162
|
+
data(:a, [0, 1, 2], group: :g1)
|
163
|
+
data(:b, [:x, :y], group: :g1)
|
164
|
+
# Group2
|
165
|
+
data(:a, [:x, :y], group: :g2)
|
166
|
+
data(:c, [-1, -2], group: :g2)
|
167
|
+
def test_data(data)
|
168
|
+
end
|
169
|
+
```
|
170
|
+
|
171
|
+
This example generates the following data matrix:
|
172
|
+
|
173
|
+
* label: `"group: :g1, a: 0, b: :x"`, data: `{a: 0, b: :x}`
|
174
|
+
* label: `"group: :g1, a: 0, b: :y"`, data: `{a: 0, b: :y}`
|
175
|
+
* label: `"group: :g1, a: 1, b: :x"`, data: `{a: 1, b: :x}`
|
176
|
+
* label: `"group: :g1, a: 1, b: :y"`, data: `{a: 1, b: :y}`
|
177
|
+
* label: `"group: :g1, a: 2, b: :x"`, data: `{a: 2, b: :x}`
|
178
|
+
* label: `"group: :g1, a: 2, b: :y"`, data: `{a: 2, b: :y}`
|
179
|
+
* label: `"group: :g2, a: :x, b: -1"`, data: `{a: :x, b: -1}`
|
180
|
+
* label: `"group: :g2, a: :x, b: -2"`, data: `{a: :x, b: -2}`
|
181
|
+
* label: `"group: :g2, a: :y, b: -1"`, data: `{a: :y, b: -1}`
|
182
|
+
* label: `"group: :g2, a: :y, b: -2"`, data: `{a: :y, b: -2}`
|
183
|
+
|
184
|
+
## 3.2.8 - 2018-05-13 {#version-3-2-8}
|
185
|
+
|
186
|
+
### Improvements
|
187
|
+
|
188
|
+
* [UI][console]: Changed to put code snippet before backtrace on
|
189
|
+
reverse mode.
|
190
|
+
|
191
|
+
## 3.2.7 - 2017-12-12 {#version-3-2-7}
|
192
|
+
|
193
|
+
### Improvements
|
194
|
+
|
195
|
+
* Added source code link to gemspec.
|
196
|
+
[GitHub#157][Patch by Grey Baker]
|
197
|
+
|
198
|
+
* Changed to use SVG image for badges in README.
|
199
|
+
[GitHub#158][Patch by Olle Jonsson]
|
200
|
+
|
201
|
+
* [UI][console]: Added `--reverse-output` option to output fault
|
202
|
+
details in reverse like Ruby 2.5. It's enabled by default only for
|
203
|
+
tty output.
|
204
|
+
|
205
|
+
### Fixes
|
206
|
+
|
207
|
+
* Fixed a typo.
|
208
|
+
[GitHub#156][Patch by masa kunikata]
|
209
|
+
|
210
|
+
* [UI][console]: Fixed a bug that broken align in verbose mode.
|
211
|
+
|
212
|
+
### Thanks
|
213
|
+
|
214
|
+
* masa kunikata
|
215
|
+
|
216
|
+
* Grey Baker
|
217
|
+
|
218
|
+
* Olle Jonsson
|
219
|
+
|
220
|
+
## 3.2.6 - 2017-09-21 {#version-3-2-6}
|
221
|
+
|
222
|
+
### Improvements
|
223
|
+
|
224
|
+
* Changed test file require failure to error from omission.
|
225
|
+
[GitHub#154][Patch by naofumi-fujii]
|
226
|
+
|
227
|
+
### Thanks
|
228
|
+
|
229
|
+
* naofumi-fujii
|
230
|
+
|
231
|
+
## 3.2.5 - 2017-06-24 {#version-3-2-5}
|
232
|
+
|
233
|
+
### Improvements
|
234
|
+
|
235
|
+
* Supported `--enable-frozen-string-literal` `ruby` option.
|
236
|
+
[GitHub#149][Reported by Pat Allan]
|
237
|
+
|
238
|
+
### Thanks
|
239
|
+
|
240
|
+
* Pat Allan
|
241
|
+
|
242
|
+
## 3.2.4 - 2017-05-23 {#version-3-2-4}
|
243
|
+
|
244
|
+
### Improvements
|
245
|
+
|
246
|
+
* Updated tests for Ruby 2.4. [GitHUb#136][Patch by Kazuki Tsujimoto]
|
247
|
+
|
248
|
+
* Supported power\_assert 1.0.0. [GitHub#137][Patch by Kazuki Tsujimoto]
|
249
|
+
|
250
|
+
* Added the getting started document.
|
251
|
+
[GitHub#139][GitHub#141][Patch by Hiroyuki Sato]
|
252
|
+
|
253
|
+
* Added the document for `attribute`.
|
254
|
+
[GitHub#143][Patch by Fumiaki MATSUSHIMA]
|
255
|
+
|
256
|
+
* Improved a link for GitHub. [GitHub#144][Patch by rochefort]
|
257
|
+
|
258
|
+
* Updated `.travis.yml`. [GitHub#145][Patch by Jun Aruga]
|
259
|
+
|
260
|
+
### Fixes
|
261
|
+
|
262
|
+
* Fixed a contributor name. [GitHub#131][Patch by Akira Matsuda]
|
263
|
+
|
264
|
+
* Fixed typos in document. [GitHub#132][Patch by Akira Matsuda]
|
265
|
+
|
266
|
+
* Fixed typos in document. [GitHub#134][Patch by Yuji Yaginuma]
|
267
|
+
|
268
|
+
* Fixed a bug that data label with "(" isn't supported.
|
269
|
+
[GitHub#135][Reported by Kazuki Tsujimoto]
|
270
|
+
|
271
|
+
* Fixed assertion message in English.
|
272
|
+
[GitHub#133][Reported by Khalil Fazal]
|
273
|
+
|
274
|
+
* Fixed a typo in typo fix. [GitHub#138][Patch by kami]
|
275
|
+
|
276
|
+
* Fixed a bug that target location finder may return wrong
|
277
|
+
location. [GitHub#146][Patch by Yuki Ito]
|
278
|
+
|
279
|
+
* Fixed a bug that `--no-show-detail-immediately` raises an error.
|
280
|
+
[GitHub#147][Reported by MSP-Greg]
|
281
|
+
|
282
|
+
### Thanks
|
283
|
+
|
284
|
+
* Akira Matsuda
|
285
|
+
|
286
|
+
* Yuji Yaginuma
|
287
|
+
|
288
|
+
* Kazuki Tsujimoto
|
289
|
+
|
290
|
+
* Khalil Fazal
|
291
|
+
|
292
|
+
* kami
|
293
|
+
|
294
|
+
* Hiroyuki Sato
|
295
|
+
|
296
|
+
* Fumiaki MATSUSHIMA
|
297
|
+
|
298
|
+
* rochefort
|
299
|
+
|
300
|
+
* Jun Aruga
|
301
|
+
|
302
|
+
* Yuki Ito
|
303
|
+
|
304
|
+
* MSP-Greg
|
305
|
+
|
306
|
+
## 3.2.3 - 2016-11-25 {#version-3-2-3}
|
307
|
+
|
308
|
+
### Fixes
|
309
|
+
|
310
|
+
* Fixed a bug that `--order` isn't applied.
|
311
|
+
[GitHub#129][Reported by Vít Ondruch]
|
312
|
+
|
313
|
+
### Thanks
|
314
|
+
|
315
|
+
* Vít Ondruch
|
316
|
+
|
317
|
+
## 3.2.2 - 2016-11-02 {#version-3-2-2}
|
318
|
+
|
319
|
+
### Improvements
|
320
|
+
|
321
|
+
* Improved Travis CI configuration.
|
322
|
+
[GitHub#123][Patch by Ryunosuke Sato]
|
323
|
+
|
324
|
+
* Supported Java native exception.
|
325
|
+
[GitHub#126][Reported by Bob Saveland]
|
326
|
+
|
327
|
+
### Fixes
|
328
|
+
|
329
|
+
* doc: Fixed markup. [GitHub#127][Patch by Tomohiro Hashidate]
|
330
|
+
|
331
|
+
* Fixed a bug that `--location=LINE` may not detect a test when
|
332
|
+
fixtures are defined before any tests:
|
333
|
+
|
334
|
+
1 class MyTestCase < Test::Unit::TestCase
|
335
|
+
2 setup do
|
336
|
+
3 end
|
337
|
+
4
|
338
|
+
5 test "xxx" do
|
339
|
+
6 end
|
340
|
+
7 end
|
341
|
+
|
342
|
+
`--location=5` couldn't find the `xxx` test.
|
343
|
+
|
344
|
+
[Reported by Ryota Sasabe]
|
345
|
+
|
346
|
+
### Thanks
|
347
|
+
|
348
|
+
* Ryunosuke Sato
|
349
|
+
|
350
|
+
* Tomohiro Hashidate
|
351
|
+
|
352
|
+
* Bob Saveland
|
353
|
+
|
354
|
+
* Ryota Sasabe
|
355
|
+
|
356
|
+
## 3.2.1 - 2016-07-19 {#version-3-2-1}
|
357
|
+
|
358
|
+
### Improvements
|
359
|
+
|
360
|
+
* Clarified lib/test/unit/diff.rb license. It's a triple license of
|
361
|
+
the Ruby license, PSF license and LGPLv2.1 or later.
|
362
|
+
[Reported by Luisa Pace]
|
363
|
+
|
364
|
+
* Reported norification when data driven test doesn't have
|
365
|
+
parameter.
|
366
|
+
[GitHub#122][Reported by Satoshi "Moris" Tagomori]
|
367
|
+
|
368
|
+
### Thanks
|
369
|
+
|
370
|
+
* Luisa Pace
|
371
|
+
|
372
|
+
* Satoshi "Moris" Tagomori
|
373
|
+
|
3
374
|
## 3.2.0 - 2016-06-12 {#version-3-2-0}
|
4
375
|
|
5
376
|
### Improvements
|
@@ -505,7 +876,7 @@ It's a release for minitest compatibility and bug fix.
|
|
505
876
|
|
506
877
|
* Allowed use of test for inheritance in ActionController::TestCase.
|
507
878
|
[GitHub#42] [Patch by David Rasch]
|
508
|
-
* Ensured evaluating
|
879
|
+
* Ensured evaluating at_exit block in top level.
|
509
880
|
In IRB context, exit() specifies irb_exit().
|
510
881
|
[test-unit-users-en:00089] [Reported by Daniel Berger]
|
511
882
|
* Fixed a bug that decoration style description is ignored.
|