1- /* globals describe, it */
1+ /* globals describe, it, open */
22
33/*
44 * Using ShellJS Plugins:
@@ -85,8 +85,7 @@ describe('plugin-open', function () {
8585 ret . stdout . should . equal ( '' ) ;
8686 var errorMsg = 'open: option not recognized: f' ;
8787 ret . stderr . should . equal ( errorMsg ) ;
88- // TODO(nate): refactor ShellJS to support this
89- // shell.error().should.equal(errorMsg);
88+ shell . error ( ) . should . equal ( errorMsg ) ;
9089 } ) ;
9190
9291 it ( 'cannot open files that are missing' , function ( ) {
@@ -95,8 +94,12 @@ describe('plugin-open', function () {
9594 ret . stdout . should . equal ( '' ) ;
9695 var errorMsg = 'open: Unable to locate file: missingFile.txt' ;
9796 ret . stderr . should . equal ( errorMsg ) ;
98- // TODO(nate): refactor ShellJS to support this
99- // shell.error().should.equal(errorMsg);
97+ shell . error ( ) . should . equal ( errorMsg ) ;
98+ ret = open ( 'missingFile.txt' ) ;
99+ ret . code . should . equal ( 1 ) ;
100+ ret . stdout . should . equal ( '' ) ;
101+ ret . stderr . should . equal ( errorMsg ) ;
102+ shell . error ( ) . should . equal ( errorMsg ) ;
100103 } ) ;
101104
102105 it ( 'opens URLs' , function ( ) {
0 commit comments