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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6224bf9af9a66e5759319b2b4f9fdb650f970ad4010c4f1b92cf85410df307e8
4
- data.tar.gz: d22117bf9f061839dea08df766256c7982e13d7eb1d6428c2fedff9583cd5b45
3
+ metadata.gz: f80bfdc786244d9be9030d614a8d5cefa4660c71e1d5f6e2697494ea5d351af9
4
+ data.tar.gz: abfb9b96433fc2a35f0c886069f9ffaee3428fe04a5c8b1e8ba0d726169ec320
5
5
  SHA512:
6
- metadata.gz: dfd3a287fa4496d89b11e0dc7e1d9488156ecf0158611421df03f49da3cb3130aab76ca0ecab631a00261f7766a77cde596786380b0236039dcbe0209bb29603
7
- data.tar.gz: 217463364d02fc2b93e1f689ba269345d4300519781ef6f9cf3dc3f8d8b0263d70e3065c69651398e1aec18e1b5c40e7f78e693e0eb2586e002523ba7ec43d1e
6
+ metadata.gz: 6f67a38fd41415415fa5d1d1d764208f9271d4073b657a1e7269a574a23dcb3696d1887c95a73f525000c9aa544bc7627fa36218a63d32957028f0e19fafe349
7
+ data.tar.gz: 7efafbed54a11458d00d974b120a6be1bb73a8c773877814460329972f19ef6f45ed97817a4291517fe698d03af099218530d4b445539b4810130f58f8c909dc
@@ -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
@@ -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
 
@@ -1,5 +1,5 @@
1
1
  module Test
2
2
  module Unit
3
- VERSION = "3.3.8"
3
+ VERSION = "3.3.9"
4
4
  end
5
5
  end
@@ -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.8
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-24 00:00:00.000000000 Z
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.0.rc.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.