test_bench-bootstrap 0.0.0 → 1.0.0.preview
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/test_bench/bootstrap.rb +22 -6
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa4d5648ba0703a152ffd1708f5146923287cca1f7941adad6ba3163e027d417
|
4
|
+
data.tar.gz: c8a67629f1ee3a5b4951e7ec049249486fa080d2b91197dab7b867e9c8bddaad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7b8f6a1e175d06463ada01168825aa95a4eb6e15c7404c6ccbe8e9a0605835460af8196e0ff36f9c6eafc7a46c00b0cf66acb7584658738a6f64e2c4fd52ff7
|
7
|
+
data.tar.gz: a7a91df5a063c56fd4cbca7a1d638b5e0ec86097c82a220b7f4f7576e7c646166c1e8017a4cf379f181c0b0ad0272433a1df802f811084782b2780b33e19b4e2
|
data/lib/test_bench/bootstrap.rb
CHANGED
@@ -70,6 +70,10 @@ module TestBench
|
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
73
|
+
def _context(prose=nil, &block)
|
74
|
+
context(prose)
|
75
|
+
end
|
76
|
+
|
73
77
|
def test(prose=nil, &block)
|
74
78
|
if block.nil?
|
75
79
|
Output.write(prose || 'Test', sgr_code: 0x33)
|
@@ -90,13 +94,25 @@ module TestBench
|
|
90
94
|
end
|
91
95
|
end
|
92
96
|
|
97
|
+
def _test(prose=nil, &block)
|
98
|
+
test(prose)
|
99
|
+
end
|
100
|
+
|
93
101
|
def comment(text)
|
94
102
|
Output.write(text)
|
95
103
|
end
|
96
104
|
|
105
|
+
def fixture(cls, *args, **kwargs, &block)
|
106
|
+
fixture = TestBench::Fixture.(cls, *args, **kwargs, &block)
|
107
|
+
|
108
|
+
passed = !fixture.test_run.failed?
|
109
|
+
|
110
|
+
assert(passed)
|
111
|
+
end
|
112
|
+
|
97
113
|
def self.print_error(error)
|
98
114
|
omit_backtrace_pattern = ENV['TEST_BENCH_OMIT_BACKTRACE_PATTERN']
|
99
|
-
omit_backtrace_pattern ||= %r{
|
115
|
+
omit_backtrace_pattern ||= %r{test_bench/bootstrap\.rb}
|
100
116
|
|
101
117
|
omitting = false
|
102
118
|
|
@@ -159,12 +175,12 @@ module TestBench
|
|
159
175
|
|
160
176
|
return if block.nil?
|
161
177
|
|
162
|
-
self.indentation += 1
|
178
|
+
self.indentation += 1 unless text.nil?
|
163
179
|
|
164
180
|
begin
|
165
181
|
block.()
|
166
182
|
ensure
|
167
|
-
self.indentation -= 1
|
183
|
+
self.indentation -= 1 unless text.nil?
|
168
184
|
end
|
169
185
|
end
|
170
186
|
|
@@ -202,7 +218,9 @@ module TestBench
|
|
202
218
|
exclude_file_pattern ||= %r{automated_init\.rb}
|
203
219
|
|
204
220
|
if argv.empty?
|
205
|
-
|
221
|
+
tests_dir = ENV['TEST_BENCH_TESTS_DIR'] || 'test/automated'
|
222
|
+
|
223
|
+
file_patterns = [File.join(tests_dir, '**', '*.rb')]
|
206
224
|
else
|
207
225
|
file_patterns = argv
|
208
226
|
end
|
@@ -229,6 +247,4 @@ module TestBench
|
|
229
247
|
end
|
230
248
|
end
|
231
249
|
end
|
232
|
-
|
233
|
-
Bootstrap.activate
|
234
250
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: test_bench-bootstrap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 1.0.0.preview
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Ladd
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: nathanladd+github@gmail.com
|
@@ -32,9 +32,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
32
32
|
version: '0'
|
33
33
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
34
34
|
requirements:
|
35
|
-
- - "
|
35
|
+
- - ">"
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version:
|
37
|
+
version: 1.3.1
|
38
38
|
requirements: []
|
39
39
|
rubygems_version: 3.0.1
|
40
40
|
signing_key:
|