Report for lv.id.jc.correcter.app.ApplicationSpec


Summary:

Created on Thu Jan 20 19:43:22 EET 2022 by jegors
Executed features Passed Failures Errors Skipped Success rate Time
1 1 0 0 0 100.0% 0.036 seconds

Features:

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:
mode transmission
encode Encoding the message OK
send Sending the message OK
decode Decoding the message OK
3/3 passed