Extract stdout spy library from views tests