test-unit 3.2.4 → 3.2.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/Rakefile +10 -1
- data/doc/text/news.md +11 -0
- data/lib/test/unit/assertions.rb +23 -23
- data/lib/test/unit/autorunner.rb +1 -1
- data/lib/test/unit/diff.rb +8 -8
- data/lib/test/unit/ui/emacs/testrunner.rb +5 -5
- data/lib/test/unit/version.rb +1 -1
- data/test/test-assertions.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 367cf38cdec937cd00374b17aeddd2cd85271223
|
4
|
+
data.tar.gz: 66d1270f41f63a6d324c419cb91cb8e4a4e66fed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 546256249a6ac765e2789a60feec91fd97ec4e66cbcf951897085bf378b435f81a548be56381c22ecdddda0e491b63adcacda90b74d916865f82cb4848e60098
|
7
|
+
data.tar.gz: 4e17e054bd8cdf04b401d7aee9205403be33c7a9a9e0fd7244d468897db61f5aecf9b25f4bdd3a03a75409faa8e56c6eece579b5eebab7accc1a1e48cff9f51b
|
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"
|
data/doc/text/news.md
CHANGED
@@ -1,5 +1,16 @@
|
|
1
1
|
# News
|
2
2
|
|
3
|
+
## 3.2.5 - 2017-06-24 {#version-3-2-5}
|
4
|
+
|
5
|
+
### Improvements
|
6
|
+
|
7
|
+
* Supported `--enable-frozen-string-literal` `ruby` option.
|
8
|
+
[GitHub#149][Reported by Pat Allan]
|
9
|
+
|
10
|
+
### Thanks
|
11
|
+
|
12
|
+
* Pat Allan
|
13
|
+
|
3
14
|
## 3.2.4 - 2017-05-23 {#version-3-2-4}
|
4
15
|
|
5
16
|
### Improvements
|
data/lib/test/unit/assertions.rb
CHANGED
@@ -153,8 +153,8 @@ module Test
|
|
153
153
|
assertion_message = message
|
154
154
|
else
|
155
155
|
error_message = "assertion message must be String, Proc or "
|
156
|
-
error_message
|
157
|
-
error_message
|
156
|
+
error_message += "#{AssertionMessage}: "
|
157
|
+
error_message += "<#{message.inspect}>(<#{message.class}>)"
|
158
158
|
raise ArgumentError, error_message, filter_backtrace(caller)
|
159
159
|
end
|
160
160
|
assertion_message ||= build_message(message,
|
@@ -192,8 +192,8 @@ module Test
|
|
192
192
|
assertion_message = message
|
193
193
|
else
|
194
194
|
error_message = "assertion message must be String, Proc or "
|
195
|
-
error_message
|
196
|
-
error_message
|
195
|
+
error_message += "#{AssertionMessage}: "
|
196
|
+
error_message += "<#{message.inspect}>(<#{message.class}>)"
|
197
197
|
raise ArgumentError, error_message, filter_backtrace(caller)
|
198
198
|
end
|
199
199
|
assert_block("refute should not be called with a block.") do
|
@@ -362,7 +362,7 @@ EOT
|
|
362
362
|
else
|
363
363
|
klasses = [klass]
|
364
364
|
end
|
365
|
-
assert_block("The first parameter to assert_not_instance_of should be "
|
365
|
+
assert_block("The first parameter to assert_not_instance_of should be " +
|
366
366
|
"a Class or an Array of Class.") do
|
367
367
|
klasses.all? {|k| k.is_a?(Class)}
|
368
368
|
end
|
@@ -965,7 +965,7 @@ EOT
|
|
965
965
|
end
|
966
966
|
|
967
967
|
if relation_format
|
968
|
-
format
|
968
|
+
format += <<-EOT
|
969
969
|
|
970
970
|
Relation:
|
971
971
|
#{relation_format}
|
@@ -1103,7 +1103,7 @@ EOT
|
|
1103
1103
|
end
|
1104
1104
|
|
1105
1105
|
if relation_format
|
1106
|
-
format
|
1106
|
+
format += <<-EOT
|
1107
1107
|
|
1108
1108
|
Relation:
|
1109
1109
|
#{relation_format}
|
@@ -1780,7 +1780,7 @@ EOT
|
|
1780
1780
|
|
1781
1781
|
if Diff.need_fold?(diff)
|
1782
1782
|
folded_diff = Diff.folded_readable(from, to)
|
1783
|
-
diff
|
1783
|
+
diff += "\n\nfolded diff:\n#{folded_diff}"
|
1784
1784
|
end
|
1785
1785
|
|
1786
1786
|
diff
|
@@ -1794,9 +1794,9 @@ EOT
|
|
1794
1794
|
inspector = Inspector.new(object)
|
1795
1795
|
if use_pp
|
1796
1796
|
begin
|
1797
|
-
require
|
1797
|
+
require "pp" unless defined?(PP)
|
1798
1798
|
begin
|
1799
|
-
return PP.pp(inspector,
|
1799
|
+
return PP.pp(inspector, String.new).chomp
|
1800
1800
|
rescue NameError
|
1801
1801
|
end
|
1802
1802
|
rescue LoadError
|
@@ -2045,26 +2045,26 @@ EOT
|
|
2045
2045
|
expanded_template = ""
|
2046
2046
|
@parts.each do |part|
|
2047
2047
|
if part == '?'
|
2048
|
-
|
2048
|
+
param = params.shift
|
2049
|
+
if Object.const_defined?(:Encoding)
|
2050
|
+
expanded_template += concatenatable(param,
|
2051
|
+
expanded_template.encoding)
|
2052
|
+
else
|
2053
|
+
expanded_template += param
|
2054
|
+
end
|
2049
2055
|
else
|
2050
|
-
expanded_template
|
2056
|
+
expanded_template += part.gsub(/\\\?/m, '?')
|
2051
2057
|
end
|
2052
2058
|
end
|
2053
2059
|
expanded_template
|
2054
2060
|
end
|
2055
2061
|
|
2056
2062
|
private
|
2057
|
-
|
2058
|
-
|
2059
|
-
|
2060
|
-
|
2061
|
-
|
2062
|
-
buffer << parameter.dup.force_encoding(buffer.encoding)
|
2063
|
-
end
|
2064
|
-
end
|
2065
|
-
else
|
2066
|
-
def encoding_safe_concat(buffer, parameter)
|
2067
|
-
buffer << parameter
|
2063
|
+
def concatenatable(text, encoding)
|
2064
|
+
if Encoding.compatible?(text, encoding)
|
2065
|
+
text
|
2066
|
+
else
|
2067
|
+
text.dup.force_encoding(encoding)
|
2068
2068
|
end
|
2069
2069
|
end
|
2070
2070
|
end
|
data/lib/test/unit/autorunner.rb
CHANGED
@@ -189,7 +189,7 @@ module Test
|
|
189
189
|
def options
|
190
190
|
@options ||= OptionParser.new do |o|
|
191
191
|
o.banner = "Test::Unit automatic runner."
|
192
|
-
o.banner
|
192
|
+
o.banner += "\nUsage: #{$0} [options] [-- untouched arguments]"
|
193
193
|
|
194
194
|
o.on("-r", "--runner=RUNNER", RUNNERS,
|
195
195
|
"Use the given RUNNER.",
|
data/lib/test/unit/diff.rb
CHANGED
@@ -269,7 +269,7 @@ module Test
|
|
269
269
|
|
270
270
|
private
|
271
271
|
def tag(mark, contents)
|
272
|
-
contents.collect {|content|
|
272
|
+
contents.collect {|content| mark + content}
|
273
273
|
end
|
274
274
|
end
|
275
275
|
|
@@ -450,7 +450,7 @@ module Test
|
|
450
450
|
|
451
451
|
def tag(mark, contents)
|
452
452
|
contents.each do |content|
|
453
|
-
@result <<
|
453
|
+
@result << (mark + content)
|
454
454
|
end
|
455
455
|
end
|
456
456
|
|
@@ -577,15 +577,15 @@ module Test
|
|
577
577
|
to_width = compute_width(to_line, to_start, to_end)
|
578
578
|
case tag
|
579
579
|
when :replace
|
580
|
-
from_tags
|
581
|
-
to_tags
|
580
|
+
from_tags += "^" * from_width
|
581
|
+
to_tags += "^" * to_width
|
582
582
|
when :delete
|
583
|
-
from_tags
|
583
|
+
from_tags += "-" * from_width
|
584
584
|
when :insert
|
585
|
-
to_tags
|
585
|
+
to_tags += "+" * to_width
|
586
586
|
when :equal
|
587
|
-
from_tags
|
588
|
-
to_tags
|
587
|
+
from_tags += " " * from_width
|
588
|
+
to_tags += " " * to_width
|
589
589
|
else
|
590
590
|
raise "unknown tag: #{tag}"
|
591
591
|
end
|
@@ -30,16 +30,16 @@ module Test
|
|
30
30
|
location_display = "\n" + failure.location.join("\n")
|
31
31
|
end
|
32
32
|
result = "#{failure.label}:\n"
|
33
|
-
result
|
34
|
-
result
|
33
|
+
result += "#{failure.test_name}#{location_display}:\n"
|
34
|
+
result += failure.message
|
35
35
|
result
|
36
36
|
end
|
37
37
|
|
38
38
|
def format_fault_error(error)
|
39
39
|
result = "#{error.label}:\n"
|
40
|
-
result
|
41
|
-
result
|
42
|
-
result
|
40
|
+
result += "#{error.test_name}:\n"
|
41
|
+
result += "#{error.message}\n"
|
42
|
+
result += error.backtrace.join("\n")
|
43
43
|
result
|
44
44
|
end
|
45
45
|
end
|
data/lib/test/unit/version.rb
CHANGED
data/test/test-assertions.rb
CHANGED
@@ -819,7 +819,7 @@ EOM
|
|
819
819
|
check_nothing_fails {
|
820
820
|
assert_same(thing, thing, "successful assert_same")
|
821
821
|
}
|
822
|
-
thing2 =
|
822
|
+
thing2 = thing.dup
|
823
823
|
check_fail(%Q{<"thing">\nwith id <#{thing.__id__}> was expected to be equal? to\n<"thing">\nwith id <#{thing2.__id__}>.}) {
|
824
824
|
assert_same(thing, thing2)
|
825
825
|
}
|
@@ -906,7 +906,7 @@ EOM
|
|
906
906
|
|
907
907
|
def test_assert_not_same
|
908
908
|
thing = "thing"
|
909
|
-
thing2 =
|
909
|
+
thing2 = thing.dup
|
910
910
|
check_nothing_fails {
|
911
911
|
assert_not_same(thing, thing2)
|
912
912
|
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: test-unit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.
|
4
|
+
version: 3.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kouhei Sutou
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-06-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: power_assert
|