test-unit-ruby-core 1.0.0 → 1.0.2

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: 8ce1e0a5d55058ecfbee2cd7181b21cac4b1edd85e94e5ccae89d2ac46ef870f
4
- data.tar.gz: 1c87b3bd31f58b06bf04b0cf8ad51b82c1d18c8ac373708c8eda766baf2877c1
3
+ metadata.gz: c0bc98ff517fd9116a3a66b9090011c91cae6b3195c2705ca2762ba1c02bc5ea
4
+ data.tar.gz: 0cf8f343ef9c6de619a79dc3f087fe559ee3420e59e446f30f060e596072bf25
5
5
  SHA512:
6
- metadata.gz: 3e88a5ae66883f86406139338bcb9d58b8e85fcca7712b71e929c04aef36c5e94a68f8f5209f0f653d19a2142bc81e2afbb873cc74badad129ad7d51570845f1
7
- data.tar.gz: 6232de618f5c4b20c3574aa6d0708f2e9a9b44d7d36367808a5d15b5e7b8aff7ff585f9c04d79bedb9ffa4c2c714bae34cf5e6ca60b222fdab8c8a60003fd45a
6
+ metadata.gz: 2edce635953122b9ba15206f2e70c8047903e2bcff2ba1b3f5049cc366811fba69b30ce0a23237c0197179d888342f2491807742d753a944f700d5805e6f2f61
7
+ data.tar.gz: 5e15090f910387887b76e5d24eef793bce809238f1ec916a780dde14cb25555dc34f073030a0ef581a6a5067ff4b0b624c53e4de2f8421510713e7e2d141e40d
@@ -1,6 +1,43 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Test
4
+
5
+ class << self
6
+ ##
7
+ # Filter object for backtraces.
8
+
9
+ attr_accessor :backtrace_filter
10
+ end
11
+
12
+ class BacktraceFilter # :nodoc:
13
+ def filter bt
14
+ return ["No backtrace"] unless bt
15
+
16
+ new_bt = []
17
+ pattern = %r[/(?:lib\/test/|core_assertions\.rb:)]
18
+
19
+ unless $DEBUG then
20
+ bt.each do |line|
21
+ break if pattern.match?(line)
22
+ new_bt << line
23
+ end
24
+
25
+ new_bt = bt.reject { |line| pattern.match?(line) } if new_bt.empty?
26
+ new_bt = bt.dup if new_bt.empty?
27
+ else
28
+ new_bt = bt.dup
29
+ end
30
+
31
+ new_bt
32
+ end
33
+ end
34
+
35
+ self.backtrace_filter = BacktraceFilter.new
36
+
37
+ def self.filter_backtrace bt # :nodoc:
38
+ backtrace_filter.filter bt
39
+ end
40
+
4
41
  module Unit
5
42
  module Assertions
6
43
  def assert_raises(*exp, &b)
data/lib/envutil.rb CHANGED
@@ -155,7 +155,7 @@ module EnvUtil
155
155
 
156
156
  # remain env
157
157
  %w(ASAN_OPTIONS RUBY_ON_BUG).each{|name|
158
- child_env[name] = ENV[name] if ENV[name]
158
+ child_env[name] = ENV[name] if !child_env.key?(name) and ENV.key?(name)
159
159
  }
160
160
 
161
161
  args = [args] if args.kind_of?(String)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test-unit-ruby-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroshi SHIBATA
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-06-06 00:00:00.000000000 Z
12
+ date: 2023-08-29 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Additional test assertions for Ruby standard libraries.
15
15
  email:
@@ -37,7 +37,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 2.6.0
40
+ version: '2.5'
41
41
  required_rubygems_version: !ruby/object:Gem::Requirement
42
42
  requirements:
43
43
  - - ">="