@@ -200,3 +200,67 @@ describe('page sub-generator', function () {
200
200
} ) ;
201
201
202
202
} ) ;
203
+
204
+ // ---- Module sub-generator
205
+
206
+ describe ( 'module sub-generator' , function ( ) {
207
+ beforeEach ( function ( done ) {
208
+ helpers . testDirectory ( path . join ( __dirname , 'temp' ) , function ( err ) {
209
+ if ( err ) {
210
+ return done ( err ) ;
211
+ }
212
+
213
+ this . app = helpers . createGenerator ( 'init:module' , [
214
+ '../../module'
215
+ ] , [ 'test' ] ) ;
216
+ done ( ) ;
217
+ } . bind ( this ) ) ;
218
+ } ) ;
219
+
220
+ it ( 'creates expected files for the module sub-generator' , function ( done ) {
221
+
222
+ var expected = [
223
+ 'js/modules/test.js'
224
+ ] ;
225
+
226
+ this . app . options [ 'skip-install' ] = true ;
227
+ this . app . run ( { } , function ( ) {
228
+ helpers . assertFiles ( expected ) ;
229
+ done ( ) ;
230
+ } ) ;
231
+
232
+ } ) ;
233
+
234
+ } ) ;
235
+
236
+ // ---- Jqueryplugin sub-generator
237
+
238
+ describe ( 'jqueryplugin sub-generator' , function ( ) {
239
+ beforeEach ( function ( done ) {
240
+ helpers . testDirectory ( path . join ( __dirname , 'temp' ) , function ( err ) {
241
+ if ( err ) {
242
+ return done ( err ) ;
243
+ }
244
+
245
+ this . app = helpers . createGenerator ( 'init:jqueryplugin' , [
246
+ '../../jqueryplugin'
247
+ ] , [ 'test' ] ) ;
248
+ done ( ) ;
249
+ } . bind ( this ) ) ;
250
+ } ) ;
251
+
252
+ it ( 'creates expected files for the jqueryplugin sub-generator' , function ( done ) {
253
+
254
+ var expected = [
255
+ 'js/plugins/jquery.test.js'
256
+ ] ;
257
+
258
+ this . app . options [ 'skip-install' ] = true ;
259
+ this . app . run ( { } , function ( ) {
260
+ helpers . assertFiles ( expected ) ;
261
+ done ( ) ;
262
+ } ) ;
263
+
264
+ } ) ;
265
+
266
+ } ) ;
0 commit comments