This repository was archived by the owner on Mar 26, 2018. It is now read-only.
File tree 3 files changed +63
-1
lines changed
3 files changed +63
-1
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ util.inherits(Generator, ScriptBase);
12
12
Generator . prototype . createServiceFiles = function createServiceFiles ( ) {
13
13
this . generateSourceAndTest (
14
14
'service/provider' ,
15
- 'spec/service ' ,
15
+ 'spec/provider ' ,
16
16
'services' ,
17
17
this . options [ 'skip-add' ] || false
18
18
) ;
Original file line number Diff line number Diff line change
1
+ ' use strict'
2
+
3
+ describe ' Service: <%= cameledName %>' , ->
4
+
5
+ # instantiate service
6
+ < %= cameledName % > = {}
7
+ init = ->
8
+ inject (_ < %= cameledName % > _ ) ->
9
+ < %= cameledName % > = _< %= cameledName % > _
10
+ return
11
+ return
12
+
13
+ # load the service's module
14
+ beforeEach module ' <%= scriptAppName %>'
15
+
16
+ it ' should do something' , ->
17
+ init ()
18
+ expect (!! < %= cameledName % > ).toBe true
19
+ return
20
+
21
+ it ' should be configurable' , ->
22
+ module (< %= cameledName % > Provider ) ->
23
+ < %= cameledName % > Provider .setSalutation ' Lorem ipsum'
24
+ return
25
+
26
+ init ()
27
+
28
+ expect (< %= cameledName % > .greet ()).toEqual ' Lorem ipsum'
29
+ return
30
+ return
Original file line number Diff line number Diff line change
1
+ 'use strict' ;
2
+
3
+ describe ( 'Service: <%= cameledName %>' , function ( ) {
4
+
5
+ // instantiate service
6
+ var < %= cameledName % > ,
7
+ init = function ( ) {
8
+ inject ( function ( _ < %= cameledName % > _ ) {
9
+ < %= cameledName % > = _< %= cameledName % > _;
10
+ } ) ;
11
+ } ;
12
+
13
+ // load the service's module
14
+ beforeEach ( module ( '<%= scriptAppName %>' ) ) ;
15
+
16
+ it ( 'should do something' , function ( ) {
17
+ init ( ) ;
18
+
19
+ expect ( ! ! < %= cameledName % > ).toBe(true);
20
+ } ) ;
21
+
22
+ it ( 'should be configurable' , function ( ) {
23
+ module ( function ( < %= cameledName % > Provider) {
24
+ < %= cameledName % > Provider.setSalutation('Lorem ipsum');
25
+ } );
26
+
27
+ init();
28
+
29
+ expect(< %= cameledName % > .greet()).toEqual('Lorem ipsum');
30
+ } ) ;
31
+
32
+ } ) ;
You can’t perform that action at this time.
0 commit comments