test-unit 3.3.5 → 3.4.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9a584be907dd430934f5a1c24e8dc859eda50290115cdf947d8daf2ea81d2178
4
- data.tar.gz: 3d50831298ead40ec2405252e04363c13841f85402de11d7dba8f4528484b392
3
+ metadata.gz: 60687da3bfd86cc13bce040060f2401cc62f890607d7270016fe424a226da99d
4
+ data.tar.gz: 0c53df13c6f6d6c0896c7e59928ef773b80fa0f60c5a24ab7e9096779cb41ee7
5
5
  SHA512:
6
- metadata.gz: 9b84485dbac9ba0533be8586f8c13957b3509d82ea29274c4716c93c0e9ac0481150a4fb6590be60466d17feeb480de1fb0a79eea3f5f8462a6a3ac85e2dbace
7
- data.tar.gz: 0b516c62f5ce1f23afed0eab2e7bd35416535b71c77ea0819db08b404fada1c0400bd20d497e573acae63c3d99539c96ab2df16f917315e37fadf561f4731c22
6
+ metadata.gz: 1398026ad88d187d8b4a6c706df1ba4e8eb5a315c6dbaa61a38785a0a3a2126fb6eddf2c5e0072020482b705cb3b3ebde02cc43624a5f43669cb49e2b38a501a
7
+ data.tar.gz: 00a8084948431ae2eb1db14726ebad5a2c82ac5740469ebcb4aedf73854df1a2a0ddf7754b525536a2eeedf8cb7095087db9d17abf503537becc519a88187322
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 GPL
6
- version 2 (see the file GPL), or the conditions below:
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
- 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.
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
- 2. You may modify your copy of the software in any way, provided that
13
- you do at least ONE of the following:
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
- 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.
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
- b) use the modified software only within your corporation or
21
- organization.
20
+ b. use the modified software only within your corporation or
21
+ organization.
22
22
 
23
- c) give non-standard binaries non-standard names, with
24
- instructions on where to get the original software distribution.
23
+ c. give non-standard binaries non-standard names, with
24
+ instructions on where to get the original software distribution.
25
25
 
26
- d) make other distribution arrangements with the author.
26
+ d. make other distribution arrangements with the author.
27
27
 
28
- 3. You may distribute the software in object code or binary form,
29
- provided that you do at least ONE of the following:
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
- 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.
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
- b) accompany the distribution with the machine-readable source of
36
- the software.
35
+ b. accompany the distribution with the machine-readable source of
36
+ the software.
37
37
 
38
- c) give non-standard binaries non-standard names, with
39
- instructions on where to get the original software distribution.
38
+ c. give non-standard binaries non-standard names, with
39
+ instructions on where to get the original software distribution.
40
40
 
41
- d) make other distribution arrangements with the author.
41
+ d. make other distribution arrangements with the author.
42
42
 
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.
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
- For the list of those files and their copying conditions, see the
48
- file LEGAL.
47
+ For the list of those files and their copying conditions, see the
48
+ file LEGAL.
49
49
 
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.
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
- 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.
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, PSF license and/or LGPLv2.1
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
@@ -51,17 +51,13 @@ If you want to use full test-unit features:
51
51
 
52
52
  ## License
53
53
 
54
- (The Ruby License)
55
-
56
- This software is distributed under the same terms as ruby.
54
+ This software is distributed under either the terms of new Ruby
55
+ License or BSDL. See the file [COPYING](COPYING).
57
56
 
58
57
  Exception:
59
58
 
60
- * lib/test/unit/diff.rb is a triple license of the Ruby license,
61
- PSF license and LGPLv2.1 or later.
62
-
63
- * lib/test-unit.rb is a dual license of the Ruby license and LGPLv2.1
64
- or later.
59
+ * lib/test/unit/diff.rb is a triple license of (the new Ruby license
60
+ or BSDL) and PSF license.
65
61
 
66
62
  ## Authors
67
63
 
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
 
@@ -1,5 +1,80 @@
1
1
  # News
2
2
 
3
+ ## 3.4.0 - 2021-01-30 {#version-3-4-0}
4
+
5
+ ### Improvements
6
+
7
+ * Enable deprecated warnings by default.
8
+
9
+ ## 3.3.9 - 2020-12-29 {#version-3-3-9}
10
+
11
+ ### Improvements
12
+
13
+ * `assert_not_match`: Add support for `String` as pattern.
14
+ [GitHub#178][Patch by David Rodríguez]
15
+
16
+ ### Thanks
17
+
18
+ * David Rodríguez
19
+
20
+ ## 3.3.8 - 2020-12-25 {#version-3-3-8}
21
+
22
+ ### Improvements
23
+
24
+ * [UI][console]: Removed reverse mode because Ruby 3.0 reverts
25
+ reverse backtrace.
26
+
27
+ ## 3.3.7 - 2020-11-18 {#version-3-3-7}
28
+
29
+ ### Improvements
30
+
31
+ * Improved TruffleRuby support.
32
+ [GitHub#171][Reported by Benoit Daloze]
33
+
34
+ * Removed needless `to_sym`.
35
+ [GitHub#177][Patch by icm7216]
36
+
37
+ * `assert_raise`: Added backtrace for actual error.
38
+
39
+ * Improved terminal color availability detection.
40
+ [GitHub#175][Patch by nicholas a. evans]
41
+
42
+ * Changed license to the new Ruby's.
43
+ [GitHub#174]
44
+
45
+ ### Fixes
46
+
47
+ * Fixed a typo in `--help` output:
48
+ [GitHub#176][Patch by icm7216]
49
+
50
+ ### Thanks
51
+
52
+ * Benoit Daloze
53
+
54
+ * icm7216
55
+
56
+ * nicholas a. evans
57
+
58
+ ## 3.3.6 - 2020-06-10 {#version-3-3-6}
59
+
60
+ ### Improvements
61
+
62
+ * `name`, `--ignore-name`:
63
+
64
+ * Added support for regular expression options.
65
+
66
+ * Added support for matching with class name in exact match mode.
67
+ [Reported by Jun Aruga]
68
+
69
+ * Updated ruby-talk mailing list information
70
+ [GitHub#168][Patch by Chris Kampmeier]
71
+
72
+ ### Thanks
73
+
74
+ * Chris Kampmeier
75
+
76
+ * Jun Aruga
77
+
3
78
  ## 3.3.5 - 2020-01-10 {#version-3-3-5}
4
79
 
5
80
  ### Improvements
@@ -1,21 +1,6 @@
1
1
  # Copyright (C) 2012-2015 Kouhei Sutou <kou@clear-code.com>
2
- #
3
- # License: Ruby's or LGPLv2.1 or later
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
18
- # 02110-1301 USA
2
+
3
+ require "test/unit/warning"
19
4
 
20
5
  module Test
21
6
  module Unit
@@ -1,12 +1,14 @@
1
+ require "test/unit/warning"
2
+
1
3
  require 'test/unit/testcase'
2
4
  require 'test/unit/autorunner'
3
5
 
4
6
  module Test # :nodoc:
5
7
  #
6
8
  # # Test::Unit - Ruby Unit Testing Framework
7
- #
9
+ #
8
10
  # ## Introduction
9
- #
11
+ #
10
12
  # Unit testing is making waves all over the place, largely due to the
11
13
  # fact that it is a core practice of XP. While XP is great, unit testing
12
14
  # has been around for a long time and has always been a good idea. One
@@ -18,19 +20,19 @@ module Test # :nodoc:
18
20
  # as possible, you slowly build up a wall of things that cannot break
19
21
  # without you immediately knowing about it. This is when unit testing
20
22
  # hits its peak usefulness.
21
- #
23
+ #
22
24
  # Enter Test::Unit, a framework for unit testing in Ruby, helping you to
23
25
  # design, debug and evaluate your code by making it easy to write and
24
26
  # have tests for it.
25
- #
26
- #
27
+ #
28
+ #
27
29
  # ## Notes
28
- #
30
+ #
29
31
  # Test::Unit has grown out of and superceded Lapidary.
30
- #
31
- #
32
+ #
33
+ #
32
34
  # ## Feedback
33
- #
35
+ #
34
36
  # I like (and do my best to practice) XP, so I value early releases,
35
37
  # user feedback, and clean, simple, expressive code. There is always
36
38
  # room for improvement in everything I do, and Test::Unit is no
@@ -41,73 +43,78 @@ module Test # :nodoc:
41
43
  # hear about any successes you have with Test::Unit, and any
42
44
  # documentation you might add will be greatly appreciated. My contact
43
45
  # info is below.
44
- #
45
- #
46
+ #
47
+ #
46
48
  # ## Contact Information
47
- #
48
- # A lot of discussion happens about Ruby in general on the ruby-talk
49
- # mailing list (http://www.ruby-lang.org/en/ml.html), and you can ask
50
- # any questions you might have there. I monitor the list, as do many
51
- # other helpful Rubyists, and you're sure to get a quick answer. Of
52
- # course, you're also welcome to email me (Nathaniel Talbott) directly
53
- # at mailto:testunit@talbott.ws, and I'll do my best to help you out.
54
- #
55
- #
49
+ #
50
+ # * [GitHub issues on
51
+ # test-unit/test-unit](https://github.com/test-unit/test-unit/issues):
52
+ # If you have any issues, please report them to here.
53
+ #
54
+ # * [GitHub pull requests on
55
+ # test-unit/test-unit](https://github.com/test-unit/test-unit/pulls):
56
+ # If you have any patches, please report them to here.
57
+ #
58
+ # * [ruby-talk mailing
59
+ # list](https://www.ruby-lang.org/en/community/mailing-lists/):
60
+ # If you have any questions, you can ask them here.
61
+ #
62
+ #
56
63
  # ## Credits
57
- #
64
+ #
58
65
  # I'd like to thank...
59
- #
66
+ #
60
67
  # Matz, for a great language!
61
- #
68
+ #
62
69
  # Masaki Suketa, for his work on RubyUnit, which filled a vital need in
63
70
  # the Ruby world for a very long time. I'm also grateful for his help in
64
71
  # polishing Test::Unit and getting the RubyUnit compatibility layer
65
72
  # right. His graciousness in allowing Test::Unit to supercede RubyUnit
66
73
  # continues to be a challenge to me to be more willing to defer my own
67
74
  # rights.
68
- #
75
+ #
69
76
  # Ken McKinlay, for his interest and work on unit testing, and for his
70
77
  # willingness to dialog about it. He was also a great help in pointing
71
78
  # out some of the holes in the RubyUnit compatibility layer.
72
- #
79
+ #
73
80
  # Dave Thomas, for the original idea that led to the extremely simple
74
81
  # "require 'test/unit'", plus his code to improve it even more by
75
82
  # allowing the selection of tests from the command-line. Also, without
76
83
  # RDoc, the documentation for Test::Unit would stink a lot more than it
77
84
  # does now.
78
- #
85
+ #
79
86
  # Everyone who's helped out with bug reports, feature ideas,
80
87
  # encouragement to continue, etc. It's a real privilege to be a part of
81
88
  # the Ruby community.
82
- #
89
+ #
83
90
  # The guys at RoleModel Software, for putting up with me repeating, "But
84
91
  # this would be so much easier in Ruby!" whenever we're coding in Java.
85
- #
92
+ #
86
93
  # My Creator, for giving me life, and giving it more abundantly.
87
- #
88
- #
94
+ #
95
+ #
89
96
  # ## License
90
- #
97
+ #
91
98
  # Test::Unit is copyright (c) 2000-2003 Nathaniel Talbott. It is free
92
99
  # software, and is distributed under the Ruby license. See the COPYING
93
100
  # file.
94
- #
101
+ #
95
102
  # Exception: lib/test/unit/diff.rb is copyright (c)
96
103
  # 2008-2010 Kouhei Sutou and 2001-2008 Python Software
97
104
  # Foundation. It is free software, and is distributed
98
105
  # under the Ruby license and/or the PSF license. See the
99
106
  # COPYING file and PSFL file.
100
- #
107
+ #
101
108
  # ## Warranty
102
- #
109
+ #
103
110
  # This software is provided "as is" and without any express or
104
111
  # implied warranties, including, without limitation, the implied
105
112
  # warranties of merchantibility and fitness for a particular
106
113
  # purpose.
107
- #
108
- #
114
+ #
115
+ #
109
116
  # ## Author
110
- #
117
+ #
111
118
  # Nathaniel Talbott.
112
119
  # Copyright (c) 2000-2003, Nathaniel Talbott
113
120
  #
@@ -534,12 +534,7 @@ EOT
534
534
  # assert_match(/\d+/, 'five, 6, seven')
535
535
  def assert_match(pattern, string, message=nil)
536
536
  _wrap_assertion do
537
- pattern = case(pattern)
538
- when String
539
- Regexp.new(Regexp.escape(pattern))
540
- else
541
- pattern
542
- end
537
+ pattern = Regexp.new(Regexp.escape(pattern)) if pattern.is_a?(String)
543
538
  full_message = build_message(message,
544
539
  "<?> was expected to be =~\n<?>.",
545
540
  pattern, string)
@@ -711,15 +706,13 @@ EOT
711
706
  # @example
712
707
  # assert_not_match(/two/, 'one 2 three') # -> pass
713
708
  # assert_not_match(/three/, 'one 2 three') # -> fail
714
- def assert_not_match(regexp, string, message=nil)
709
+ def assert_not_match(pattern, string, message=nil)
715
710
  _wrap_assertion do
716
- assert_instance_of(Regexp, regexp,
717
- "<REGEXP> in assert_not_match(<REGEXP>, ...) " +
718
- "should be a Regexp.")
711
+ pattern = Regexp.new(Regexp.escape(pattern)) if pattern.is_a?(String)
719
712
  full_message = build_message(message,
720
713
  "<?> was expected to not match\n<?>.",
721
- regexp, string)
722
- assert_block(full_message) { regexp !~ string }
714
+ pattern, string)
715
+ assert_block(full_message) { pattern !~ string }
723
716
  end
724
717
  end
725
718
 
@@ -2121,7 +2114,14 @@ EOT
2121
2114
 
2122
2115
  def inspect
2123
2116
  if default_inspect?
2124
- "#{@exception.class.inspect}(<#{@exception.message}>)"
2117
+ inspected = "#{@exception.class.inspect}(<#{@exception.message}>)"
2118
+ unless (@exception.backtrace || []).empty?
2119
+ inspected += "\n"
2120
+ @exception.backtrace.each do |trace|
2121
+ inspected << "#{trace}\n"
2122
+ end
2123
+ end
2124
+ inspected
2125
2125
  else
2126
2126
  @exception.inspect
2127
2127
  end