tldr 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/tldr/assertions.rb +2 -2
- data/lib/tldr/backtrace_filter.rb +1 -5
- data/lib/tldr/reporters/default.rb +2 -4
- data/lib/tldr/version.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: 3655d1f785633e79f19d40a25c91a10d8c1ff15ce2f5e0b40d54ad78483e8e1f
|
4
|
+
data.tar.gz: f384808928adc35578b5ac6788b97722a469854baf8c44aab488c0028502a096
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6977d2609fcd88cd24477b8f5fb18459fbc38dbda79680afde50f1600220de4e1bb21bb603d275e04cdae211958d472dedcefc5c41e8b8388078131bd8edd972
|
7
|
+
data.tar.gz: 5d32c88bd6fab7d2a159f531895fd080c5aa34eaddebc220af7221d2101f83c7dcb4e30a2787cd9534a41c6e64408935ef160d4f0fa527b2377bab4c3082f787
|
data/CHANGELOG.md
CHANGED
data/lib/tldr/assertions.rb
CHANGED
@@ -28,7 +28,7 @@ class TLDR
|
|
28
28
|
SuperDiff::EqualityMatchers::Main.call(expected:, actual:)
|
29
29
|
end
|
30
30
|
|
31
|
-
def
|
31
|
+
def capture_io
|
32
32
|
captured_stdout, captured_stderr = StringIO.new, StringIO.new
|
33
33
|
|
34
34
|
original_stdout, original_stderr = $stdout, $stderr
|
@@ -204,7 +204,7 @@ class TLDR
|
|
204
204
|
def assert_output expected_stdout, expected_stderr, message = nil, &block
|
205
205
|
assert_block "assert_output requires a block to capture output" unless block
|
206
206
|
|
207
|
-
actual_stdout, actual_stderr =
|
207
|
+
actual_stdout, actual_stderr = capture_io(&block)
|
208
208
|
|
209
209
|
if Regexp === expected_stderr
|
210
210
|
assert_match expected_stderr, actual_stderr, "In stderr"
|
@@ -1,8 +1,6 @@
|
|
1
1
|
class TLDR
|
2
2
|
class BacktraceFilter
|
3
3
|
BASE_PATH = __dir__.freeze
|
4
|
-
SORBET_RUNTIME_PATTERN = %r{sorbet-runtime.*[/\\]lib[/\\]types[/\\]private[/\\]}
|
5
|
-
CONCURRENT_RUBY_PATTERN = %r{concurrent-ruby.*[/\\]lib[/\\]concurrent-ruby[/\\]concurrent[/\\]}
|
6
4
|
|
7
5
|
def filter backtrace
|
8
6
|
return ["No backtrace"] unless backtrace
|
@@ -32,9 +30,7 @@ class TLDR
|
|
32
30
|
end
|
33
31
|
|
34
32
|
def internal? frame
|
35
|
-
frame.start_with?(BASE_PATH)
|
36
|
-
frame.match?(SORBET_RUNTIME_PATTERN) ||
|
37
|
-
frame.match?(CONCURRENT_RUBY_PATTERN)
|
33
|
+
frame.start_with?(BASE_PATH)
|
38
34
|
end
|
39
35
|
end
|
40
36
|
|
@@ -73,10 +73,8 @@ class TLDR
|
|
73
73
|
duration = time_diff @suite_start_time
|
74
74
|
test_results = test_results.sort_by { |result| [result.test.location.file, result.test.location.line] }
|
75
75
|
|
76
|
-
@out.print "\n\n"
|
77
76
|
@err.print summarize_failures(test_results).join("\n\n")
|
78
77
|
|
79
|
-
@out.print "\n\n"
|
80
78
|
@out.print summarize_skips(test_results).join("\n")
|
81
79
|
|
82
80
|
@out.print "\n\n"
|
@@ -102,7 +100,7 @@ class TLDR
|
|
102
100
|
failures = results.select { |result| result.failing? }
|
103
101
|
return failures if failures.empty?
|
104
102
|
|
105
|
-
["
|
103
|
+
["\n\nFailing tests:"] + failures.map.with_index { |result, i| summarize_result result, i }
|
106
104
|
end
|
107
105
|
|
108
106
|
def summarize_result result, index
|
@@ -119,7 +117,7 @@ class TLDR
|
|
119
117
|
skips = results.select { |result| result.skip? }
|
120
118
|
return skips if skips.empty?
|
121
119
|
|
122
|
-
["
|
120
|
+
["\n\nSkipped tests:\n"] + skips.map { |result| " - #{describe(result.test)}" }
|
123
121
|
end
|
124
122
|
|
125
123
|
def describe test, location = test.location
|
data/lib/tldr/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tldr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Searls
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-09-
|
12
|
+
date: 2023-09-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: super_diff
|
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
101
101
|
- !ruby/object:Gem::Version
|
102
102
|
version: '0'
|
103
103
|
requirements: []
|
104
|
-
rubygems_version: 3.4.
|
104
|
+
rubygems_version: 3.4.17
|
105
105
|
signing_key:
|
106
106
|
specification_version: 4
|
107
107
|
summary: TLDR will run your tests, but only for 1.8 seconds.
|