Sha256: d0d92ec233feea418deee223a0f60bf337289f504d5cd96e2e92bc66d0d8bde6

Contents?: true

Size: 1.28 KB

Versions: 14

Compression:

Stored size: 1.28 KB

Contents

[<< back](README.md)

# debug

* Debug your tests.

```
> tree examples/10-debug

examples/10-debug
├── config.yaml
├── external.rb
├── internal.rb
└── start.rb
```

Tests grows and becames huge, with a lot of targets (That isn't a problem). Then, we organize them spliting into several files and invoke `use` keywork from our main rb file to load other files (That's good idea).

Sometimes we need to verify or check rb file consistency and syntax, and we will do it with `teuton check PATH/TO/PROJECT/FOLDER`.

## Debug

Every time we invoke `run` keywork, an OS command is executed. The output is showed on screen and saved into **result** internal object.

We could debug it invoking `result.debug` into our tests. Let's see an example from `external.rb` file:

```ruby
# File: external.rb

group "Windows: external configuration from localhost" do

  target "From localhost, check if exist connectivity with #{get(:windows_ip)}"
  run    "ping #{get(:windows_ip)} -c 1"
  result.debug
  expect_one "0% packet loss"
  result.debug

  target "From localhost, check if Netbios-ssn service working on #{get(:windows_ip)}"
  run    "nmap -Pn #{get(:windows_ip)}"
  expect "139/tcp", "open"

end
```

`result.debug` it's usefull when you are verifying command output captured by Teuton.

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
teuton-2.9.2 docs/learn/10-debug.md
teuton-2.9.1 docs/learn/10-debug.md
teuton-2.9.0 docs/learn/10-debug.md
teuton-2.8.0 docs/learn/10-debug.md
teuton-2.7.3 docs/learn/10-debug.md
teuton-2.7.2 docs/learn/10-debug.md
teuton-2.7.1 docs/learn/10-debug.md
teuton-2.7.0 docs/learn/10-debug.md
teuton-2.6.0 docs/learn/10-debug.md
teuton-2.5.0 docs/learn/10-debug.md
teuton-2.4.5 docs/learn/10-debug.md
teuton-2.4.4 docs/learn/10-debug.md
teuton-2.4.3 docs/learn/10-debug.md
teuton-2.4.2 docs/learn/10-debug.md