| Executed features | Passed | Failures | Errors | Skipped | Success rate | Time |
|---|---|---|---|---|---|---|
| 1 | 1 | 0 | 0 | 0 | 100.0% | 0.036 seconds |
|
should prompt the user for a command and execute it
Return
|
|||||||||||||
|
Given:
|
we set the system input with our content
|
||||||||||||
System.setIn new ByteArrayInputStream(mode.bytes) |
|||||||||||||
|
And:
|
we create an application with dummy transmissions
|
||||||||||||
@Subject
def app = new Application([
encode: { println 'Encoding the message' },
send : { println 'Sending the message ' },
decode: { println 'Decoding the message' }
])
|
|||||||||||||
|
When:
|
we run the application
|
||||||||||||
app.run() |
|||||||||||||
|
And:
|
we get the application output as string
|
||||||||||||
def output = out.toString() |
|||||||||||||
|
Then:
|
the output contains a prompt for a transmission mode
|
||||||||||||
output.contains 'Write a mode' |
|||||||||||||
|
And:
|
the selected mode was called and it printed the result
|
||||||||||||
output.contains transmission |
|||||||||||||
|
Where:
|
we define transmission modes and their results as
|
||||||||||||
|
Examples:
|
|
3/3 passed
|
|||||||||||