@@ -41,9 +41,8 @@ def call; end
4141 describe 'test add notification with invalid params' do
4242 it 'should log and return nil if notification type is empty' do
4343 expect ( notification_center . add_notification_listener (
44- nil ,
45- @callback_reference
46- ) ) . to eq ( nil )
44+ nil , @callback_reference
45+ ) ) . to eq ( nil )
4746 expect ( spy_logger ) . to have_received ( :log ) . once
4847 . with ( Logger ::ERROR , 'Notification type can not be empty.' )
4948 end
@@ -52,7 +51,7 @@ def call; end
5251 expect ( notification_center . add_notification_listener (
5352 Optimizely ::NotificationCenter ::NOTIFICATION_TYPES [ :ACTIVATE ] ,
5453 nil
55- ) ) . to eq ( nil )
54+ ) ) . to eq ( nil )
5655 expect ( spy_logger ) . to have_received ( :log ) . once
5756 . with ( Logger ::ERROR , 'Callback can not be empty.' )
5857 end
@@ -61,7 +60,7 @@ def call; end
6160 expect ( notification_center . add_notification_listener (
6261 'Test notification type' ,
6362 @callback_reference
64- ) ) . to eq ( nil )
63+ ) ) . to eq ( nil )
6564 expect ( spy_logger ) . to have_received ( :log ) . once
6665 . with ( Logger ::ERROR , 'Invalid notification type.' )
6766 end
@@ -70,7 +69,7 @@ def call; end
7069 expect ( notification_center . add_notification_listener (
7170 Optimizely ::NotificationCenter ::NOTIFICATION_TYPES [ :ACTIVATE ] ,
7271 'Invalid callback!'
73- ) ) . to eq ( nil )
72+ ) ) . to eq ( nil )
7473 expect ( spy_logger ) . to have_received ( :log ) . once
7574 . with ( Logger ::ERROR , 'Invalid notification callback given.' )
7675 end
@@ -81,7 +80,7 @@ def call; end
8180 expect ( notification_center . add_notification_listener (
8281 Optimizely ::NotificationCenter ::NOTIFICATION_TYPES [ :ACTIVATE ] ,
8382 @callback_reference
84- ) ) . to eq ( 1 )
83+ ) ) . to eq ( 1 )
8584 # verifies that one notification is added
8685 expect ( notification_center . notifications [ Optimizely ::NotificationCenter ::NOTIFICATION_TYPES [ :ACTIVATE ] ] . length )
8786 . to eq ( 1 )
@@ -95,7 +94,7 @@ def call; end
9594 expect ( notification_center . add_notification_listener (
9695 value ,
9796 @callback_reference
98- ) ) . to eq ( notification_id )
97+ ) ) . to eq ( notification_id )
9998 end
10099 notification_center . notifications . each_key do |key |
101100 expect ( notification_center . notifications [ key ] . length )
@@ -141,19 +140,19 @@ def call; end
141140 expect ( notification_center . add_notification_listener (
142141 Optimizely ::NotificationCenter ::NOTIFICATION_TYPES [ :ACTIVATE ] ,
143142 @callback_reference
144- ) ) . to eq ( -1 )
143+ ) ) . to eq ( -1 )
145144 end
146145
147146 it 'should add same callback for a different notification type' do
148147 expect ( notification_center . add_notification_listener (
149148 Optimizely ::NotificationCenter ::NOTIFICATION_TYPES [ :ACTIVATE ] ,
150149 @callback_reference
151- ) ) . to eq ( 1 )
150+ ) ) . to eq ( 1 )
152151
153152 expect ( notification_center . add_notification_listener (
154153 Optimizely ::NotificationCenter ::NOTIFICATION_TYPES [ :TRACK ] ,
155154 @callback_reference
156- ) ) . to eq ( 2 )
155+ ) ) . to eq ( 2 )
157156 end
158157 end
159158
@@ -169,18 +168,18 @@ def call; end
169168 expect ( @inner_notification_center . add_notification_listener (
170169 Optimizely ::NotificationCenter ::NOTIFICATION_TYPES [ :ACTIVATE ] ,
171170 @callback_reference
172- ) ) . to eq ( 1 )
171+ ) ) . to eq ( 1 )
173172
174173 expect ( @inner_notification_center . add_notification_listener (
175174 Optimizely ::NotificationCenter ::NOTIFICATION_TYPES [ :TRACK ] ,
176175 @callback_reference
177- ) ) . to eq ( 2 )
176+ ) ) . to eq ( 2 )
178177
179178 # add another callback for NOTIFICATION_TYPES::ACTIVATE
180179 expect ( @inner_notification_center . add_notification_listener (
181180 Optimizely ::NotificationCenter ::NOTIFICATION_TYPES [ :ACTIVATE ] ,
182181 @callback_reference_second
183- ) ) . to eq ( 3 )
182+ ) ) . to eq ( 3 )
184183 # Verify that notifications length for NOTIFICATION_TYPES::ACTIVATE is 2
185184 expect ( @inner_notification_center . notifications [
186185 Optimizely ::NotificationCenter ::NOTIFICATION_TYPES [ :ACTIVATE ] ] . length ) . to eq ( 2 )
@@ -338,27 +337,27 @@ def call; end
338337 expect ( @inner_notification_center . add_notification_listener (
339338 Optimizely ::NotificationCenter ::NOTIFICATION_TYPES [ :ACTIVATE ] ,
340339 @callback_reference
341- ) ) . to eq ( 1 )
340+ ) ) . to eq ( 1 )
342341
343342 expect ( @inner_notification_center . add_notification_listener (
344343 Optimizely ::NotificationCenter ::NOTIFICATION_TYPES [ :ACTIVATE ] ,
345344 @callback_reference_second
346- ) ) . to eq ( 2 )
345+ ) ) . to eq ( 2 )
347346
348347 expect ( @inner_notification_center . add_notification_listener (
349348 Optimizely ::NotificationCenter ::NOTIFICATION_TYPES [ :ACTIVATE ] ,
350349 @callback_reference_third
351- ) ) . to eq ( 3 )
350+ ) ) . to eq ( 3 )
352351
353352 expect ( @inner_notification_center . add_notification_listener (
354353 Optimizely ::NotificationCenter ::NOTIFICATION_TYPES [ :TRACK ] ,
355354 @callback_reference
356- ) ) . to eq ( 4 )
355+ ) ) . to eq ( 4 )
357356
358357 expect ( @inner_notification_center . add_notification_listener (
359358 Optimizely ::NotificationCenter ::NOTIFICATION_TYPES [ :TRACK ] ,
360359 @callback_reference_second
361- ) ) . to eq ( 5 )
360+ ) ) . to eq ( 5 )
362361
363362 # verify that notifications length for each type reflects the just added callbacks
364363
0 commit comments