@@ -31,18 +31,6 @@ describe('$interpolate', function() {
31
31
expect ( $interpolate ( 'Hello {{name}}!' ) ( $rootScope ) ) . toEqual ( 'Hello Misko!' ) ;
32
32
} ) ) ;
33
33
34
- describe ( 'provider' , function ( ) {
35
- beforeEach ( module ( function ( $interpolateProvider ) {
36
- $interpolateProvider . startSymbol ( '--' ) ;
37
- $interpolateProvider . endSymbol ( '--' ) ;
38
- } ) ) ;
39
-
40
- it ( 'should not get confused with same markers' , inject ( function ( $interpolate ) {
41
- expect ( $interpolate ( '---' ) . parts ) . toEqual ( [ '---' ] ) ;
42
- expect ( $interpolate ( '----' ) ( ) ) . toEqual ( '' ) ;
43
- expect ( $interpolate ( '--1--' ) ( ) ) . toEqual ( '1' ) ;
44
- } ) ) ;
45
- } ) ;
46
34
47
35
describe ( 'parseBindings' , function ( ) {
48
36
it ( 'should Parse Text With No Bindings' , inject ( function ( $interpolate ) {
@@ -110,4 +98,46 @@ describe('$interpolate', function() {
110
98
expect ( parts [ 2 ] ) . toEqual ( 'C\nD"' ) ;
111
99
} ) ) ;
112
100
} ) ;
101
+
102
+
103
+ describe ( 'startSymbol' , function ( ) {
104
+
105
+ beforeEach ( module ( function ( $interpolateProvider ) {
106
+ expect ( $interpolateProvider . startSymbol ( ) ) . toBe ( '{{' ) ;
107
+ $interpolateProvider . startSymbol ( '((' ) ;
108
+ } ) ) ;
109
+
110
+
111
+ it ( 'should expose the startSymbol in config phase' , module ( function ( $interpolateProvider ) {
112
+ expect ( $interpolateProvider . startSymbol ( ) ) . toBe ( '((' ) ;
113
+ } ) ) ;
114
+
115
+
116
+ it ( 'should not get confused by matching start and end symbols' , function ( ) {
117
+ module ( function ( $interpolateProvider ) {
118
+ $interpolateProvider . startSymbol ( '--' ) ;
119
+ $interpolateProvider . endSymbol ( '--' ) ;
120
+ } ) ;
121
+
122
+ inject ( function ( $interpolate ) {
123
+ expect ( $interpolate ( '---' ) . parts ) . toEqual ( [ '---' ] ) ;
124
+ expect ( $interpolate ( '----' ) ( ) ) . toEqual ( '' ) ;
125
+ expect ( $interpolate ( '--1--' ) ( ) ) . toEqual ( '1' ) ;
126
+ } ) ;
127
+ } ) ;
128
+ } ) ;
129
+
130
+
131
+ describe ( 'endSymbol' , function ( ) {
132
+
133
+ beforeEach ( module ( function ( $interpolateProvider ) {
134
+ expect ( $interpolateProvider . endSymbol ( ) ) . toBe ( '}}' ) ;
135
+ $interpolateProvider . endSymbol ( '))' ) ;
136
+ } ) ) ;
137
+
138
+
139
+ it ( 'should expose the endSymbol in config phase' , module ( function ( $interpolateProvider ) {
140
+ expect ( $interpolateProvider . endSymbol ( ) ) . toBe ( '))' ) ;
141
+ } ) ) ;
142
+ } ) ;
113
143
} ) ;
0 commit comments