11describe ( 'angular.scenario.Future' , function ( ) {
22 var future ;
3-
3+
44 it ( 'should set the sane defaults' , function ( ) {
55 var behavior = function ( ) { } ;
66 var future = new angular . scenario . Future ( 'test name' , behavior , 'foo' ) ;
@@ -11,15 +11,15 @@ describe('angular.scenario.Future', function() {
1111 expect ( future . fulfilled ) . toBeFalsy ( ) ;
1212 expect ( future . parser ) . toEqual ( angular . identity ) ;
1313 } ) ;
14-
14+
1515 it ( 'should be fulfilled after execution and done callback' , function ( ) {
1616 var future = new angular . scenario . Future ( 'test name' , function ( done ) {
1717 done ( ) ;
1818 } ) ;
1919 future . execute ( angular . noop ) ;
2020 expect ( future . fulfilled ) . toBeTruthy ( ) ;
2121 } ) ;
22-
22+
2323 it ( 'should take callback with (error, result) and forward' , function ( ) {
2424 var future = new angular . scenario . Future ( 'test name' , function ( done ) {
2525 done ( 10 , 20 ) ;
@@ -29,31 +29,31 @@ describe('angular.scenario.Future', function() {
2929 expect ( result ) . toEqual ( 20 ) ;
3030 } ) ;
3131 } ) ;
32-
32+
3333 it ( 'should use error as value if provided' , function ( ) {
3434 var future = new angular . scenario . Future ( 'test name' , function ( done ) {
3535 done ( 10 , 20 ) ;
3636 } ) ;
3737 future . execute ( angular . noop ) ;
3838 expect ( future . value ) . toEqual ( 10 ) ;
3939 } ) ;
40-
40+
4141 it ( 'should parse json with fromJson' , function ( ) {
4242 var future = new angular . scenario . Future ( 'test name' , function ( done ) {
4343 done ( null , "{test: 'foo'}" ) ;
4444 } ) ;
4545 future . fromJson ( ) . execute ( angular . noop ) ;
4646 expect ( future . value ) . toEqual ( { test : 'foo' } ) ;
4747 } ) ;
48-
48+
4949 it ( 'should convert to json with toJson' , function ( ) {
5050 var future = new angular . scenario . Future ( 'test name' , function ( done ) {
5151 done ( null , { test : 'foo' } ) ;
5252 } ) ;
5353 future . toJson ( ) . execute ( angular . noop ) ;
5454 expect ( future . value ) . toEqual ( '{"test":"foo"}' ) ;
5555 } ) ;
56-
56+
5757 it ( 'should convert with custom parser' , function ( ) {
5858 var future = new angular . scenario . Future ( 'test name' , function ( done ) {
5959 done ( null , 'foo' ) ;
@@ -63,13 +63,13 @@ describe('angular.scenario.Future', function() {
6363 } ) . execute ( angular . noop ) ;
6464 expect ( future . value ) . toEqual ( 'FOO' ) ;
6565 } ) ;
66-
66+
6767 it ( 'should pass error if parser fails' , function ( ) {
6868 var future = new angular . scenario . Future ( 'test name' , function ( done ) {
6969 done ( null , '{' ) ;
7070 } ) ;
7171 future . fromJson ( ) . execute ( function ( error , result ) {
7272 expect ( error ) . toBeDefined ( ) ;
7373 } ) ;
74- } ) ;
74+ } ) ;
7575} ) ;
0 commit comments