tui-td 0.2.1 → 0.2.2
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/tui_td/cli.rb +7 -1
- data/lib/tui_td/driver.rb +9 -0
- data/lib/tui_td/test_runner.rb +16 -0
- data/lib/tui_td/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b74325984554c843a191d5affcf77472229000da6f14551c26ca2e6f1b0425cd
|
|
4
|
+
data.tar.gz: 2ddeb1aaedfc23ca62e3e791bb254950ef4432a32f0031e0a144f7567e2a3785
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b02944c10ed90a607ccfadd80fe80237a1bd5d50bba8e92320875c3cc71181f04057d2cad78648f5ddefee7a149b179c215c12b0ed61a19af7363b658090e36a
|
|
7
|
+
data.tar.gz: fe0f2b747cc15fe39da0195c83371ef44c457194f1648aa5e4e03f525ac856a60f3561a482012009054158350d354ea7cf28a04ab75eb9d660c1712203364373
|
data/CHANGELOG.md
CHANGED
data/lib/tui_td/cli.rb
CHANGED
|
@@ -367,8 +367,14 @@ module TUITD
|
|
|
367
367
|
{"html": "<path>"}
|
|
368
368
|
Save an HTML render. Path defaults to /tmp/tui_td_<ts>.html.
|
|
369
369
|
|
|
370
|
+
{"wait_for_exit": true}
|
|
371
|
+
Wait until the process exits naturally.
|
|
372
|
+
|
|
373
|
+
{"assert_exit": <N>}
|
|
374
|
+
Assert the process exit status equals N.
|
|
375
|
+
|
|
370
376
|
{"close": true}
|
|
371
|
-
Close the driver session.
|
|
377
|
+
Close the driver session (force-kill if needed).
|
|
372
378
|
|
|
373
379
|
Example test file: examples/echo_test.json
|
|
374
380
|
HELP
|
data/lib/tui_td/driver.rb
CHANGED
|
@@ -117,6 +117,15 @@ module TUITD
|
|
|
117
117
|
@wait_thr&.value
|
|
118
118
|
end
|
|
119
119
|
|
|
120
|
+
# Get the process exit status (nil if still running)
|
|
121
|
+
def exitstatus
|
|
122
|
+
return nil unless @wait_thr
|
|
123
|
+
status = @wait_thr.value
|
|
124
|
+
status&.exitstatus
|
|
125
|
+
rescue NoMethodError
|
|
126
|
+
nil
|
|
127
|
+
end
|
|
128
|
+
|
|
120
129
|
# Get the terminal output (raw ANSI + text)
|
|
121
130
|
def raw_output
|
|
122
131
|
read_available!
|
data/lib/tui_td/test_runner.rb
CHANGED
|
@@ -136,6 +136,22 @@ module TUITD
|
|
|
136
136
|
HtmlRenderer.new(driver.state_data).render(path)
|
|
137
137
|
Result.new(step: action, passed: true, message: "Saved: #{path}")
|
|
138
138
|
|
|
139
|
+
when "wait_for_exit"
|
|
140
|
+
ensure_driver!(driver)
|
|
141
|
+
driver.wait_for_exit
|
|
142
|
+
status = driver.exitstatus
|
|
143
|
+
Result.new(step: action, passed: true, message: "Exited with status #{status}")
|
|
144
|
+
|
|
145
|
+
when "assert_exit"
|
|
146
|
+
ensure_driver!(driver)
|
|
147
|
+
expected = value.to_s.to_i
|
|
148
|
+
actual = driver.exitstatus
|
|
149
|
+
if actual == expected
|
|
150
|
+
Result.new(step: action, passed: true, message: "Exit status #{expected} matches")
|
|
151
|
+
else
|
|
152
|
+
Result.new(step: action, passed: false, message: "Exit status #{actual}, expected #{expected}")
|
|
153
|
+
end
|
|
154
|
+
|
|
139
155
|
when "close"
|
|
140
156
|
driver&.close
|
|
141
157
|
driver = nil
|
data/lib/tui_td/version.rb
CHANGED