Capture all commands and outputs in test and assert_equal to expected