@@ -75,17 +75,35 @@ describe('plugin-open', function () {
7575 ( typeof pluginOpen . open ) . should . equal ( 'function' ) ;
7676 } ) ;
7777
78+ it ( 'does not accept options/flags' , function ( ) {
79+ /*
80+ * Plugins are an easy way of specifying what options/flags your command
81+ * supports
82+ */
83+ var ret = shell . open ( '-f' , 'test' ) ;
84+ ret . code . should . equal ( 1 ) ;
85+ ret . stdout . should . equal ( '' ) ;
86+ var errorMsg = 'open: option not recognized: f' ;
87+ ret . stderr . should . equal ( errorMsg ) ;
88+ // TODO(nate): refactor ShellJS to support this
89+ // shell.error().should.equal(errorMsg);
90+ } ) ;
91+
7892 it ( 'cannot open files that are missing' , function ( ) {
7993 var ret = shell . open ( 'missingFile.txt' ) ;
8094 ret . code . should . equal ( 1 ) ;
8195 ret . stdout . should . equal ( '' ) ;
82- ret . stderr . should . equal ( 'open: Unable to locate file: missingFile.txt' ) ;
96+ var errorMsg = 'open: Unable to locate file: missingFile.txt' ;
97+ ret . stderr . should . equal ( errorMsg ) ;
98+ // TODO(nate): refactor ShellJS to support this
99+ // shell.error().should.equal(errorMsg);
83100 } ) ;
84101
85102 it ( 'opens URLs' , function ( ) {
86103 var ret = shell . open ( 'https://www.google.com' ) ;
87104 ret . code . should . equal ( 0 ) ;
88105 assert . ok ( ! ret . stderr ) ;
106+ assert . ok ( ! shell . error ( ) ) ;
89107 } ) ;
90108
91109 it ( 'opens files asynchronously' , function ( ) {
@@ -95,6 +113,7 @@ describe('plugin-open', function () {
95113 ret . code . should . equal ( 0 ) ;
96114 ret . stdout . should . equal ( '' ) ;
97115 assert . ok ( ! ret . stderr ) ;
116+ assert . ok ( ! shell . error ( ) ) ;
98117 } ) ;
99118
100119 it ( 'handles glob characters' , function ( ) {
@@ -106,5 +125,6 @@ describe('plugin-open', function () {
106125 ret . code . should . equal ( 0 ) ;
107126 ret . stdout . should . equal ( '' ) ;
108127 assert . ok ( ! ret . stderr ) ;
128+ assert . ok ( ! shell . error ( ) ) ;
109129 } ) ;
110130} ) ;
0 commit comments