test-unit-ruby-core 1.0.1 → 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: 130204065e0951a22550d7abdfcf483101ac6921bcd995af38071066f0975bc9
4
- data.tar.gz: ada32e32e4bbe5c3810d6fe4c81caeee616e8a38abf64be88e03adfda5c12d47
3
+ metadata.gz: c0bc98ff517fd9116a3a66b9090011c91cae6b3195c2705ca2762ba1c02bc5ea
4
+ data.tar.gz: 0cf8f343ef9c6de619a79dc3f087fe559ee3420e59e446f30f060e596072bf25
5
5
  SHA512:
6
- metadata.gz: 65825877dd97ea1483e54e071adb014593bae9b633072c487ca94cd27b6033ba794486b954b9565c35b47316873c23ace2a9f893b21de7d9a3aa1ab3490ea5a3
7
- data.tar.gz: '0873cfe7000ca93a82697e9de1ada4238376e7f4db3e7577b23a42b3f389d25bca05557147e149a361235599143be480f3e854557e89b62f6c7394734394eb53'
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.1
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-07 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:
@@ -44,7 +44,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
44
44
  - !ruby/object:Gem::Version
45
45
  version: '0'
46
46
  requirements: []
47
- rubygems_version: 3.3.26
47
+ rubygems_version: 3.5.0.dev
48
48
  signing_key:
49
49
  specification_version: 4
50
50
  summary: Additional test assertions for Ruby standard libraries.