Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Commit 1136cd8

Browse files
committed
chore(scope): clean up style / remove $
1 parent 8f865e5 commit 1136cd8

File tree

1 file changed

+29
-25
lines changed

1 file changed

+29
-25
lines changed

test/core/scope_spec.dart

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ main() => describe('scope', () {
184184
}));
185185
});
186186

187+
187188
describe('properties', () {
188189
describe('root', () {
189190
it('should point to itself', inject((RootScope rootScope) {
@@ -213,6 +214,7 @@ main() => describe('scope', () {
213214
});
214215
});
215216

217+
216218
describe(r'events', () {
217219

218220
describe('on', () {
@@ -482,7 +484,8 @@ main() => describe('scope', () {
482484
});
483485
});
484486

485-
describe(r'$destroy', () {
487+
488+
describe(r'destroy', () {
486489
var first = null, middle = null, last = null, log = null;
487490

488491
beforeEach(inject((RootScope rootScope) {
@@ -531,7 +534,7 @@ main() => describe('scope', () {
531534
}));
532535

533536

534-
it(r'should broadcast the $destroy event', inject((RootScope rootScope) {
537+
it(r'should broadcast the destroy event', inject((RootScope rootScope) {
535538
var log = [];
536539
first.on(ScopeEvent.DESTROY).listen((s) => log.add('first'));
537540
first.createChild({}).on(ScopeEvent.DESTROY).listen((s) => log.add('first-child'));
@@ -540,7 +543,8 @@ main() => describe('scope', () {
540543
expect(log).toEqual(['first', 'first-child']);
541544
}));
542545
});
543-
546+
547+
544548
describe('digest lifecycle', () {
545549
it(r'should apply expression with full lifecycle', inject((RootScope rootScope) {
546550
var log = '';
@@ -554,16 +558,16 @@ main() => describe('scope', () {
554558
it(r'should catch exceptions', () {
555559
module((Module module) => module.type(ExceptionHandler, implementedBy: LoggingExceptionHandler));
556560
inject((RootScope rootScope, ExceptionHandler e) {
557-
LoggingExceptionHandler $exceptionHandler = e;
561+
LoggingExceptionHandler exceptionHandler = e;
558562
var log = [];
559563
var child = rootScope.createChild({});
560564
rootScope.watch('a', (a, _) => log.add('1'));
561565
rootScope.context['a'] = 0;
562566
child.apply(() { throw 'MyError'; });
563567
expect(log.join(',')).toEqual('1');
564-
expect($exceptionHandler.errors[0].error).toEqual('MyError');
565-
$exceptionHandler.errors.removeAt(0);
566-
$exceptionHandler.assertEmpty();
568+
expect(exceptionHandler.errors[0].error).toEqual('MyError');
569+
exceptionHandler.errors.removeAt(0);
570+
exceptionHandler.assertEmpty();
567571
});
568572
});
569573

@@ -584,11 +588,11 @@ main() => describe('scope', () {
584588

585589
it(r'should execute and return value and update', inject(
586590
(RootScope rootScope, ExceptionHandler e) {
587-
LoggingExceptionHandler $exceptionHandler = e;
591+
LoggingExceptionHandler exceptionHandler = e;
588592
rootScope.context['name'] = 'abc';
589593
expect(rootScope.apply((context) => context['name'])).toEqual('abc');
590594
expect(log).toEqual('digest;digest;');
591-
$exceptionHandler.assertEmpty();
595+
exceptionHandler.assertEmpty();
592596
}));
593597

594598

@@ -599,11 +603,11 @@ main() => describe('scope', () {
599603

600604

601605
it(r'should catch exception and update', inject((RootScope rootScope, ExceptionHandler e) {
602-
LoggingExceptionHandler $exceptionHandler = e;
606+
LoggingExceptionHandler exceptionHandler = e;
603607
var error = 'MyError';
604608
rootScope.apply(() { throw error; });
605609
expect(log).toEqual('digest;digest;');
606-
expect($exceptionHandler.errors[0].error).toEqual(error);
610+
expect(exceptionHandler.errors[0].error).toEqual(error);
607611
}));
608612
});
609613

@@ -613,8 +617,8 @@ main() => describe('scope', () {
613617
expect(() => rootScope.apply(() { throw error; })).toThrow(error);
614618
}));
615619
});
616-
617-
620+
621+
618622
describe('flush lifecycle', () {
619623
it(r'should apply expression with full lifecycle', inject((RootScope rootScope) {
620624
var log = '';
@@ -637,16 +641,16 @@ main() => describe('scope', () {
637641
it(r'should catch exceptions', () {
638642
module((Module module) => module.type(ExceptionHandler, implementedBy: LoggingExceptionHandler));
639643
inject((RootScope rootScope, ExceptionHandler e) {
640-
LoggingExceptionHandler $exceptionHandler = e;
644+
LoggingExceptionHandler exceptionHandler = e;
641645
var log = [];
642646
var child = rootScope.createChild({});
643647
rootScope.observe('a', (a, _) => log.add('1'));
644648
rootScope.context['a'] = 0;
645649
child.apply(() { throw 'MyError'; });
646650
expect(log.join(',')).toEqual('1');
647-
expect($exceptionHandler.errors[0].error).toEqual('MyError');
648-
$exceptionHandler.errors.removeAt(0);
649-
$exceptionHandler.assertEmpty();
651+
expect(exceptionHandler.errors[0].error).toEqual('MyError');
652+
exceptionHandler.errors.removeAt(0);
653+
exceptionHandler.assertEmpty();
650654
});
651655
});
652656

@@ -667,11 +671,11 @@ main() => describe('scope', () {
667671

668672
it(r'should execute and return value and update', inject(
669673
(RootScope rootScope, ExceptionHandler e) {
670-
LoggingExceptionHandler $exceptionHandler = e;
674+
LoggingExceptionHandler exceptionHandler = e;
671675
rootScope.context['name'] = 'abc';
672676
expect(rootScope.apply((context) => context['name'])).toEqual('abc');
673677
expect(log).toEqual('digest;digest;');
674-
$exceptionHandler.assertEmpty();
678+
exceptionHandler.assertEmpty();
675679
}));
676680

677681
it(r'should execute and return value and update', inject((RootScope rootScope) {
@@ -680,11 +684,11 @@ main() => describe('scope', () {
680684
}));
681685

682686
it(r'should catch exception and update', inject((RootScope rootScope, ExceptionHandler e) {
683-
LoggingExceptionHandler $exceptionHandler = e;
687+
LoggingExceptionHandler exceptionHandler = e;
684688
var error = 'MyError';
685689
rootScope.apply(() { throw error; });
686690
expect(log).toEqual('digest;digest;');
687-
expect($exceptionHandler.errors[0].error).toEqual(error);
691+
expect(exceptionHandler.errors[0].error).toEqual(error);
688692
}));
689693

690694
it(r'should throw assertion when model changes in flush', inject((RootScope rootScope, Logger log) {
@@ -793,12 +797,12 @@ main() => describe('scope', () {
793797
module.type(ExceptionHandler, implementedBy: LoggingExceptionHandler);
794798
});
795799
inject((RootScope rootScope, ExceptionHandler e) {
796-
LoggingExceptionHandler $exceptionHandler = e;
800+
LoggingExceptionHandler exceptionHandler = e;
797801
rootScope.watch('a', (n, o) {throw 'abc';});
798802
rootScope.context['a'] = 1;
799803
rootScope.digest();
800-
expect($exceptionHandler.errors.length).toEqual(1);
801-
expect($exceptionHandler.errors[0].error).toEqual('abc');
804+
expect(exceptionHandler.errors.length).toEqual(1);
805+
expect(exceptionHandler.errors[0].error).toEqual('abc');
802806
});
803807
});
804808

@@ -990,7 +994,7 @@ main() => describe('scope', () {
990994
expect(log).toEqual('parent.async;parent.digest;');
991995
}));
992996

993-
it(r'should cause a $digest rerun', inject((RootScope rootScope) {
997+
it(r'should cause a digest rerun', inject((RootScope rootScope) {
994998
rootScope.context['log'] = '';
995999
rootScope.context['value'] = 0;
9961000
// NOTE(deboer): watch listener string functions not yet supported

0 commit comments

Comments
 (0)