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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2434731fd0c15251a24a4e29168f4b9c7b5332d83eb9d50143225f5e13102404
4
- data.tar.gz: c2827f1bbeef39368e675960b896f93e0369ee64e167094108c1ca8a0838afde
3
+ metadata.gz: b74325984554c843a191d5affcf77472229000da6f14551c26ca2e6f1b0425cd
4
+ data.tar.gz: 2ddeb1aaedfc23ca62e3e791bb254950ef4432a32f0031e0a144f7567e2a3785
5
5
  SHA512:
6
- metadata.gz: 50f1ade06d2f2c921a77c4af6a4ff5a770754de165bf4e619c0d8ba21b73365d6172ea55f1863345e874ff32f5c5b997b0cae9cdb25ea844190a10d2f67cb324
7
- data.tar.gz: e7c60585ec015b1b86d1b9f9a2546297f7eb4605f3af1ecf1048182fbfb09f4916a0c590d4ee4c955174b555f736b2b11fd2255df07bca3d4ae0fa53c44475f5
6
+ metadata.gz: b02944c10ed90a607ccfadd80fe80237a1bd5d50bba8e92320875c3cc71181f04057d2cad78648f5ddefee7a149b179c215c12b0ed61a19af7363b658090e36a
7
+ data.tar.gz: fe0f2b747cc15fe39da0195c83371ef44c457194f1648aa5e4e03f525ac856a60f3561a482012009054158350d354ea7cf28a04ab75eb9d660c1712203364373
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.2.2
4
+
5
+ - `wait_for_exit` and `assert_exit` test steps — test process exit codes
6
+
3
7
  ## 0.2.1
4
8
 
5
9
  - `Driver#refresh` — explicit state re-parse for MCP server clients
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!
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TUITD
4
- VERSION = "0.2.1"
4
+ VERSION = "0.2.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tui-td
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Haluk Durmus