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 +4 -4
- data/lib/core_assertions.rb +37 -0
- data/lib/envutil.rb +1 -1
- 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: c0bc98ff517fd9116a3a66b9090011c91cae6b3195c2705ca2762ba1c02bc5ea
|
4
|
+
data.tar.gz: 0cf8f343ef9c6de619a79dc3f087fe559ee3420e59e446f30f060e596072bf25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2edce635953122b9ba15206f2e70c8047903e2bcff2ba1b3f5049cc366811fba69b30ce0a23237c0197179d888342f2491807742d753a944f700d5805e6f2f61
|
7
|
+
data.tar.gz: 5e15090f910387887b76e5d24eef793bce809238f1ec916a780dde14cb25555dc34f073030a0ef581a6a5067ff4b0b624c53e4de2f8421510713e7e2d141e40d
|
data/lib/core_assertions.rb
CHANGED
@@ -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
|
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.
|
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-
|
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.
|
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.
|