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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 130204065e0951a22550d7abdfcf483101ac6921bcd995af38071066f0975bc9
4
- data.tar.gz: ada32e32e4bbe5c3810d6fe4c81caeee616e8a38abf64be88e03adfda5c12d47
3
+ metadata.gz: 9f554b151ece8fd19038fc65a8ed133249214146782d42649de51d3b351ac4de
4
+ data.tar.gz: 17fedec74b0949584a4d95f1e96f1f09b5f72d6dba4c145a9042b9d452877876
5
5
  SHA512:
6
- metadata.gz: 65825877dd97ea1483e54e071adb014593bae9b633072c487ca94cd27b6033ba794486b954b9565c35b47316873c23ace2a9f893b21de7d9a3aa1ab3490ea5a3
7
- data.tar.gz: '0873cfe7000ca93a82697e9de1ada4238376e7f4db3e7577b23a42b3f389d25bca05557147e149a361235599143be480f3e854557e89b62f6c7394734394eb53'
6
+ metadata.gz: cf31c18554a01de7eac133c3f7938e24f71e06f24afc4ef37a2490a89747c8cca7d8e2995c9c498b85c5d195655778017ffa2ce642fd7920e01bdd3841d16c7c
7
+ data.tar.gz: 016c5320e8c780976956643c26a147b1c98f71e5553807b6704f054dc324c5262522978ee22e31df78f9dddae2027e329376aff24ad39269cda4d684d2c5902b
@@ -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 |clk|
745
- if Process.const_defined?(clk)
746
- [clk.to_sym, Process.const_get(clk)].find do |clk|
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[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.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-06-07 00:00:00.000000000 Z
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.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.