test-unit 3.3.4 → 3.3.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8559bf050780c83fa9e6ff438ac369f279e108300637b4f91766bf16e074b95a
4
- data.tar.gz: 250688e7308d7a22110bce25ce3e171fa0dd0cc9d2da828522b8ccefb30ec94e
3
+ metadata.gz: f80bfdc786244d9be9030d614a8d5cefa4660c71e1d5f6e2697494ea5d351af9
4
+ data.tar.gz: abfb9b96433fc2a35f0c886069f9ffaee3428fe04a5c8b1e8ba0d726169ec320
5
5
  SHA512:
6
- metadata.gz: 19e0050adf3340836e1591632b001ac69c995497b37a55eb741d17a469f43d78e4b7160fc030b063ad334d79ea4ad904cadc219ffa6bed8324e3bc3cb83cb83e
7
- data.tar.gz: 6e2e87365ac089e6ee0d6ec168340384510be4c6f228f14092b5231731c0a9856077071eff267dd02dd9f81d188391d3a9e2bd29920b351849f786476b333774
6
+ metadata.gz: 6f67a38fd41415415fa5d1d1d764208f9271d4073b657a1e7269a574a23dcb3696d1887c95a73f525000c9aa544bc7627fa36218a63d32957028f0e19fafe349
7
+ data.tar.gz: 7efafbed54a11458d00d974b120a6be1bb73a8c773877814460329972f19ef6f45ed97817a4291517fe698d03af099218530d4b445539b4810130f58f8c909dc
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,85 @@
1
1
  # News
2
2
 
3
+ ## 3.3.9 - 2020-12-29 {#version-3-3-9}
4
+
5
+ ### Improvements
6
+
7
+ * `assert_not_match`: Add support for `String` as pattern.
8
+ [GitHub#178][Patch by David Rodríguez]
9
+
10
+ ### Thanks
11
+
12
+ * David Rodríguez
13
+
14
+ ## 3.3.8 - 2020-12-25 {#version-3-3-8}
15
+
16
+ ### Improvements
17
+
18
+ * [UI][console]: Removed reverse mode because Ruby 3.0 reverts
19
+ reverse backtrace.
20
+
21
+ ## 3.3.7 - 2020-11-18 {#version-3-3-7}
22
+
23
+ ### Improvements
24
+
25
+ * Improved TruffleRuby support.
26
+ [GitHub#171][Reported by Benoit Daloze]
27
+
28
+ * Removed needless `to_sym`.
29
+ [GitHub#177][Patch by icm7216]
30
+
31
+ * `assert_raise`: Added backtrace for actual error.
32
+
33
+ * Improved terminal color availability detection.
34
+ [GitHub#175][Patch by nicholas a. evans]
35
+
36
+ * Changed license to the new Ruby's.
37
+ [GitHub#174]
38
+
39
+ ### Fixes
40
+
41
+ * Fixed a typo in `--help` output:
42
+ [GitHub#176][Patch by icm7216]
43
+
44
+ ### Thanks
45
+
46
+ * Benoit Daloze
47
+
48
+ * icm7216
49
+
50
+ * nicholas a. evans
51
+
52
+ ## 3.3.6 - 2020-06-10 {#version-3-3-6}
53
+
54
+ ### Improvements
55
+
56
+ * `name`, `--ignore-name`:
57
+
58
+ * Added support for regular expression options.
59
+
60
+ * Added support for matching with class name in exact match mode.
61
+ [Reported by Jun Aruga]
62
+
63
+ * Updated ruby-talk mailing list information
64
+ [GitHub#168][Patch by Chris Kampmeier]
65
+
66
+ ### Thanks
67
+
68
+ * Chris Kampmeier
69
+
70
+ * Jun Aruga
71
+
72
+ ## 3.3.5 - 2020-01-10 {#version-3-3-5}
73
+
74
+ ### Improvements
75
+
76
+ * Improved code snippet showing with different default external encoding.
77
+ [GitHub#166][Patch by Yuta Iwama]
78
+
79
+ ### Thanks
80
+
81
+ * Yuta Iwama
82
+
3
83
  ## 3.3.4 - 2019-09-30 {#version-3-3-4}
4
84
 
5
85
  ### Improvements
@@ -1,21 +1,4 @@
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
19
2
 
20
3
  module Test
21
4
  module Unit
@@ -4,9 +4,9 @@ require 'test/unit/autorunner'
4
4
  module Test # :nodoc:
5
5
  #
6
6
  # # Test::Unit - Ruby Unit Testing Framework
7
- #
7
+ #
8
8
  # ## Introduction
9
- #
9
+ #
10
10
  # Unit testing is making waves all over the place, largely due to the
11
11
  # fact that it is a core practice of XP. While XP is great, unit testing
12
12
  # has been around for a long time and has always been a good idea. One
@@ -18,19 +18,19 @@ module Test # :nodoc:
18
18
  # as possible, you slowly build up a wall of things that cannot break
19
19
  # without you immediately knowing about it. This is when unit testing
20
20
  # hits its peak usefulness.
21
- #
21
+ #
22
22
  # Enter Test::Unit, a framework for unit testing in Ruby, helping you to
23
23
  # design, debug and evaluate your code by making it easy to write and
24
24
  # have tests for it.
25
- #
26
- #
25
+ #
26
+ #
27
27
  # ## Notes
28
- #
28
+ #
29
29
  # Test::Unit has grown out of and superceded Lapidary.
30
- #
31
- #
30
+ #
31
+ #
32
32
  # ## Feedback
33
- #
33
+ #
34
34
  # I like (and do my best to practice) XP, so I value early releases,
35
35
  # user feedback, and clean, simple, expressive code. There is always
36
36
  # room for improvement in everything I do, and Test::Unit is no
@@ -41,73 +41,78 @@ module Test # :nodoc:
41
41
  # hear about any successes you have with Test::Unit, and any
42
42
  # documentation you might add will be greatly appreciated. My contact
43
43
  # info is below.
44
- #
45
- #
44
+ #
45
+ #
46
46
  # ## 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
- #
47
+ #
48
+ # * [GitHub issues on
49
+ # test-unit/test-unit](https://github.com/test-unit/test-unit/issues):
50
+ # If you have any issues, please report them to here.
51
+ #
52
+ # * [GitHub pull requests on
53
+ # test-unit/test-unit](https://github.com/test-unit/test-unit/pulls):
54
+ # If you have any patches, please report them to here.
55
+ #
56
+ # * [ruby-talk mailing
57
+ # list](https://www.ruby-lang.org/en/community/mailing-lists/):
58
+ # If you have any questions, you can ask them here.
59
+ #
60
+ #
56
61
  # ## Credits
57
- #
62
+ #
58
63
  # I'd like to thank...
59
- #
64
+ #
60
65
  # Matz, for a great language!
61
- #
66
+ #
62
67
  # Masaki Suketa, for his work on RubyUnit, which filled a vital need in
63
68
  # the Ruby world for a very long time. I'm also grateful for his help in
64
69
  # polishing Test::Unit and getting the RubyUnit compatibility layer
65
70
  # right. His graciousness in allowing Test::Unit to supercede RubyUnit
66
71
  # continues to be a challenge to me to be more willing to defer my own
67
72
  # rights.
68
- #
73
+ #
69
74
  # Ken McKinlay, for his interest and work on unit testing, and for his
70
75
  # willingness to dialog about it. He was also a great help in pointing
71
76
  # out some of the holes in the RubyUnit compatibility layer.
72
- #
77
+ #
73
78
  # Dave Thomas, for the original idea that led to the extremely simple
74
79
  # "require 'test/unit'", plus his code to improve it even more by
75
80
  # allowing the selection of tests from the command-line. Also, without
76
81
  # RDoc, the documentation for Test::Unit would stink a lot more than it
77
82
  # does now.
78
- #
83
+ #
79
84
  # Everyone who's helped out with bug reports, feature ideas,
80
85
  # encouragement to continue, etc. It's a real privilege to be a part of
81
86
  # the Ruby community.
82
- #
87
+ #
83
88
  # The guys at RoleModel Software, for putting up with me repeating, "But
84
89
  # this would be so much easier in Ruby!" whenever we're coding in Java.
85
- #
90
+ #
86
91
  # My Creator, for giving me life, and giving it more abundantly.
87
- #
88
- #
92
+ #
93
+ #
89
94
  # ## License
90
- #
95
+ #
91
96
  # Test::Unit is copyright (c) 2000-2003 Nathaniel Talbott. It is free
92
97
  # software, and is distributed under the Ruby license. See the COPYING
93
98
  # file.
94
- #
99
+ #
95
100
  # Exception: lib/test/unit/diff.rb is copyright (c)
96
101
  # 2008-2010 Kouhei Sutou and 2001-2008 Python Software
97
102
  # Foundation. It is free software, and is distributed
98
103
  # under the Ruby license and/or the PSF license. See the
99
104
  # COPYING file and PSFL file.
100
- #
105
+ #
101
106
  # ## Warranty
102
- #
107
+ #
103
108
  # This software is provided "as is" and without any express or
104
109
  # implied warranties, including, without limitation, the implied
105
110
  # warranties of merchantibility and fitness for a particular
106
111
  # purpose.
107
- #
108
- #
112
+ #
113
+ #
109
114
  # ## Author
110
- #
115
+ #
111
116
  # Nathaniel Talbott.
112
117
  # Copyright (c) 2000-2003, Nathaniel Talbott
113
118
  #
@@ -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