test-unit 3.3.8 → 3.3.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/text/news.md +11 -0
- data/lib/test/unit/assertions.rb +5 -12
- data/lib/test/unit/version.rb +1 -1
- data/test/test-assertions.rb +7 -10
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f80bfdc786244d9be9030d614a8d5cefa4660c71e1d5f6e2697494ea5d351af9
|
4
|
+
data.tar.gz: abfb9b96433fc2a35f0c886069f9ffaee3428fe04a5c8b1e8ba0d726169ec320
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f67a38fd41415415fa5d1d1d764208f9271d4073b657a1e7269a574a23dcb3696d1887c95a73f525000c9aa544bc7627fa36218a63d32957028f0e19fafe349
|
7
|
+
data.tar.gz: 7efafbed54a11458d00d974b120a6be1bb73a8c773877814460329972f19ef6f45ed97817a4291517fe698d03af099218530d4b445539b4810130f58f8c909dc
|
data/doc/text/news.md
CHANGED
@@ -1,5 +1,16 @@
|
|
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
|
+
|
3
14
|
## 3.3.8 - 2020-12-25 {#version-3-3-8}
|
4
15
|
|
5
16
|
### Improvements
|
data/lib/test/unit/assertions.rb
CHANGED
@@ -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 =
|
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(
|
709
|
+
def assert_not_match(pattern, string, message=nil)
|
715
710
|
_wrap_assertion do
|
716
|
-
|
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
|
-
|
722
|
-
assert_block(full_message) {
|
714
|
+
pattern, string)
|
715
|
+
assert_block(full_message) { pattern !~ string }
|
723
716
|
end
|
724
717
|
end
|
725
718
|
|
data/lib/test/unit/version.rb
CHANGED
data/test/test-assertions.rb
CHANGED
@@ -956,16 +956,6 @@ EOM
|
|
956
956
|
end
|
957
957
|
end
|
958
958
|
|
959
|
-
def test_assert_not_match_fail_not_regexp
|
960
|
-
check_fail("<REGEXP> in assert_not_match(<REGEXP>, ...) " +
|
961
|
-
"should be a Regexp.\n" +
|
962
|
-
"<\"asdf\"> was expected to be instance_of?\n" +
|
963
|
-
"<Regexp> but was\n" +
|
964
|
-
"<String>.") do
|
965
|
-
assert_not_match("asdf", "asdf")
|
966
|
-
end
|
967
|
-
end
|
968
|
-
|
969
959
|
def test_assert_not_match_fail_match
|
970
960
|
check_fail("</string/> was expected to not match\n" +
|
971
961
|
"<\"string\">.") do
|
@@ -973,6 +963,13 @@ EOM
|
|
973
963
|
end
|
974
964
|
end
|
975
965
|
|
966
|
+
def test_assert_not_match_fail_match_string
|
967
|
+
check_fail("</asdf/> was expected to not match\n" +
|
968
|
+
"<\"asdf\">.") do
|
969
|
+
assert_not_match("asdf", "asdf")
|
970
|
+
end
|
971
|
+
end
|
972
|
+
|
976
973
|
def test_assert_not_match_fail_match_with_message
|
977
974
|
check_fail("message.\n" +
|
978
975
|
"</string/> was expected to not match\n" +
|
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.3.
|
4
|
+
version: 3.3.9
|
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: 2020-12-
|
12
|
+
date: 2020-12-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: power_assert
|
@@ -231,7 +231,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
231
231
|
- !ruby/object:Gem::Version
|
232
232
|
version: '0'
|
233
233
|
requirements: []
|
234
|
-
rubygems_version: 3.2.
|
234
|
+
rubygems_version: 3.2.3
|
235
235
|
signing_key:
|
236
236
|
specification_version: 4
|
237
237
|
summary: An xUnit family unit testing framework for Ruby.
|