test-unit-ruby-core 1.0.1 → 1.0.3
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 +40 -3
- 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: 9f554b151ece8fd19038fc65a8ed133249214146782d42649de51d3b351ac4de
|
4
|
+
data.tar.gz: 17fedec74b0949584a4d95f1e96f1f09b5f72d6dba4c145a9042b9d452877876
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf31c18554a01de7eac133c3f7938e24f71e06f24afc4ef37a2490a89747c8cca7d8e2995c9c498b85c5d195655778017ffa2ce642fd7920e01bdd3841d16c7c
|
7
|
+
data.tar.gz: 016c5320e8c780976956643c26a147b1c98f71e5553807b6704f054dc324c5262522978ee22e31df78f9dddae2027e329376aff24ad39269cda4d684d2c5902b
|
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)
|
@@ -741,9 +778,9 @@ eom
|
|
741
778
|
%w[
|
742
779
|
CLOCK_THREAD_CPUTIME_ID CLOCK_PROCESS_CPUTIME_ID
|
743
780
|
CLOCK_MONOTONIC
|
744
|
-
].find do |
|
745
|
-
if Process.const_defined?(
|
746
|
-
[
|
781
|
+
].find do |c|
|
782
|
+
if Process.const_defined?(c)
|
783
|
+
[c.to_sym, Process.const_get(c)].find do |clk|
|
747
784
|
Process.clock_gettime(clk)
|
748
785
|
rescue
|
749
786
|
# Constants may be defined but not implemented, e.g., mingw.
|
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.3
|
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-09-12 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.
|