docs/learn/21-exit_codes.md in teuton-2.6.0 vs docs/learn/21-exit_codes.md in teuton-2.7.0
- old
+ new
@@ -1,24 +1,17 @@
[<< back](README.md)
-# Example: 16-exit_codes
+# Example: exit_codes
-_I am sorry! We have not solved the problem of getting the exit code of the commands so that it works for any platform. But we can help you do this work._
+`result` stores information from the last command executed by a "run" action. [Offers many functions](../dsl/definition/result.md)) that transforms output data, and also exitcode is captured.
-`result` stores information from the last command executed by a "run" action. [Offers many functions](../dsl/definition/result.md)) that transforms output data, but also we have been added tow more: first and last.
+## Example
-## Description
-
-Take a look at this section:
```ruby
target "Exist user root"
- run "id root;echo $?"
- expect_last "0"
-```
+ run "id root"
+ expect_exit 0
-It is posible to invoke the execution of several commands in sequence "cmd1;cmd2". Keep in mind that the last one must show the exit code. In the case of GNU/Linux is "echo $?", but it is different on others OOSS.
-
-All terminal output generated by `run` action is captured (Use `result.debug` to show result content into screen), and as we need only the last line, we use `expect_last "0"`.
-
-> More information about:
-> * [expect](../dsl/definition/expect.md) keyword.
-> * [result](../dsl/execution/result.md) keyword.
+ target "No user vader"
+ run "id vader"
+ expect_exit 1
+```