test_bench-bootstrap 7.0.4 → 7.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ffad46b8fef75ec4d281d1adc923a3da04ed8396b9c8011d5fb77e902b7ad91a
4
- data.tar.gz: bd8f1d4872f6d485e1628c4d9e075d7a33cf4257e7b1112ab74f98b01bae9667
3
+ metadata.gz: cf7f57ee22ad5761a0adb7987c0f1384088230b586640e00cb97bb547e8c7b93
4
+ data.tar.gz: 62301f4c4e43ac4acabba4c970e3b1feb047ccdcd54c070b19865849877b75a7
5
5
  SHA512:
6
- metadata.gz: d5a9d7c65a7a77fdde22e5106323629ddd0bbd57a4aa8b231939d1bfb610cbcafca5ef94df1079447aff50118830eb6a67960de6a245dd5871ec96b3bd27b5ce
7
- data.tar.gz: 56d6cd6e15ad4e77e208040bc95d1ac194b90bf1525f7aed954664ee6d18385c5d057356b47c4d1eb53942d3177f5e053396c37f21ea0a49473f2936ba1cb78b
6
+ metadata.gz: a1f872c6b59b4b8a0d103facd550357625ae57346cabf13f47adbebd90b7598359696b591e1bec8cf98f97f5e6672e9a315efb45d8cd897eabb60d215c9d815c
7
+ data.tar.gz: 0b4ab78d6098aeea0a765d4b16a41e604f571b1baf58837147f0c583a6af4f9d344ded30cc35ed7edafedeaaae8dc4bb30fbc1f2a6d3a430b89533fa4c3eef47
@@ -76,8 +76,8 @@ module TestBenchBootstrap
76
76
  receiver.public_send(:"#{attr_name}=", instance)
77
77
  end
78
78
 
79
- def self.call(path, exclude: nil)
80
- session = establish_session
79
+ def self.call(path, session: nil, exclude: nil)
80
+ session ||= establish_session
81
81
 
82
82
  instance = build(exclude:, session:)
83
83
 
@@ -95,7 +95,7 @@ module TestBenchBootstrap
95
95
  def call(&block)
96
96
  block.(self)
97
97
 
98
- session.isolate.stop
98
+ session.close
99
99
 
100
100
  if print_summary?
101
101
  summary.print
@@ -118,9 +118,6 @@ module TestBenchBootstrap
118
118
 
119
119
  session.execute(file_path)
120
120
  end
121
-
122
- rescue SelectFiles::PathNotFoundError
123
- session.execute(path)
124
121
  end
125
122
  alias :<< :path
126
123
 
@@ -18,17 +18,7 @@ module TestBenchBootstrap
18
18
  @paths ||= []
19
19
  end
20
20
 
21
- attr_accessor :raise_path_not_found_error
22
-
23
- def raise_path_not_found_error!
24
- self.raise_path_not_found_error = true
25
- end
26
-
27
21
  def call(path, &block)
28
- if raise_path_not_found_error
29
- raise PathNotFoundError
30
- end
31
-
32
22
  self.paths << path
33
23
 
34
24
  files.each(&block)
@@ -2,8 +2,6 @@ module TestBenchBootstrap
2
2
  module TestBench
3
3
  class Run
4
4
  class SelectFiles
5
- PathNotFoundError = Class.new(RuntimeError)
6
-
7
5
  def exclude_patterns
8
6
  @exclude_patterns ||= []
9
7
  end
@@ -31,7 +29,8 @@ module TestBenchBootstrap
31
29
  def call(path, &block)
32
30
  full_path = ::File.expand_path(path, apex_directory)
33
31
  if not ::File.exist?(full_path)
34
- raise PathNotFoundError, "No such file or directory - #{full_path}"
32
+ block.(path)
33
+ return
35
34
  end
36
35
 
37
36
  extension = ::File.extname(path)
@@ -68,14 +68,14 @@ module TestBenchBootstrap
68
68
  end
69
69
 
70
70
  module Comment
71
- def self.call(text: nil, apex_directory: nil)
71
+ def self.call(text: nil, apex_directory: nil, relative: nil)
72
72
  text ||= self.text
73
73
 
74
74
  basename = "write_comment__#{text.gsub(' ', '_')}"
75
75
 
76
76
  content = Content.example(text:)
77
77
 
78
- Create.(content, basename:, apex_directory:)
78
+ Create.(content, basename:, apex_directory:, relative:)
79
79
  end
80
80
 
81
81
  def self.content
@@ -38,12 +38,12 @@ module TestBenchBootstrap
38
38
  end
39
39
  attr_writer :assertion_sequence
40
40
 
41
- def self.build
41
+ def self.build(apex_directory: nil)
42
42
  instance = new
43
43
 
44
44
  Telemetry.configure(instance)
45
45
  Exception::FormatBacktrace.configure(instance)
46
- Isolate.configure(instance)
46
+ Isolate.configure(instance, apex_directory:)
47
47
 
48
48
  instance
49
49
  end
@@ -67,6 +67,10 @@ module TestBenchBootstrap
67
67
  instance.register_telemetry_sink(telemetry_sink)
68
68
  end
69
69
 
70
+ def close
71
+ isolate.stop
72
+ end
73
+
70
74
  def assert(value, failure_message)
71
75
  self.assertion_sequence += 1
72
76
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test_bench-bootstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.4
4
+ version: 7.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brightworks Digital