extract capture stdout
refactor spec to capture stdout and look at lines