public
Description: Prototype JavaScript framework
Homepage: http://prototypejs.org/
Clone URL: git://github.com/sstephenson/prototype.git
Search Repo:
prototype: Remove usage of the  statement from unit tests.
tobie (author)
Sun Mar 16 11:53:51 -0700 2008
commit  c01cb850c17a36d4a48c84ec77240061ccf37c7f
tree    281a65134b563ff2b74578d44d0b0b38ead08f2f
parent  87ce1533e45d8db092ce8a6096f19e2cb4e1157c
...
 
 
1
2
3
...
1
2
3
4
5
0
@@ -1,3 +1,5 @@
0
+* Remove usage of the `with` statement from unit tests. [Tobie Langel]
0
+
0
 * Complete rewrite of the deprecation helper, now renamed UpdateHelper and useable by third-party libs. [Tobie Langel]
0
 
0
 * Make Element#writeAttribute handle frameborder attribute in IE. Closes #11068. [staaky, Tobie Langel]
...
76
77
78
79
80
81
 
 
 
82
83
 
84
85
 
86
87
88
 
89
90
91
92
 
93
94
95
 
96
97
98
 
99
100
101
102
 
103
104
 
105
106
 
107
108
 
109
110
111
 
112
113
114
115
 
116
117
118
 
119
120
 
121
122
 
123
124
 
125
126
127
 
128
129
130
131
 
132
133
134
135
 
 
136
137
 
138
139
 
140
141
142
 
143
144
145
 
146
147
148
149
 
 
150
151
 
152
153
 
154
155
156
157
 
158
159
 
160
161
 
162
163
 
164
165
166
 
167
168
169
 
170
171
172
173
 
 
174
175
 
176
177
 
178
179
180
 
181
182
183
 
184
185
186
 
187
188
189
 
190
191
192
 
193
194
195
 
196
197
198
 
199
200
201
 
202
203
204
 
205
206
207
 
208
209
210
211
 
 
212
213
 
214
215
216
 
 
217
218
 
219
220
 
221
222
223
224
 
225
226
227
228
229
230
 
231
232
233
234
 
235
236
237
 
238
239
240
241
 
242
243
244
245
246
 
247
248
249
250
 
251
252
253
254
255
 
256
257
258
259
260
 
 
261
262
 
263
264
 
265
266
267
268
 
 
269
270
 
271
272
273
274
275
 
276
277
278
 
279
280
281
282
 
283
284
 
285
286
287
...
76
77
78
 
 
 
79
80
81
82
 
83
84
 
85
86
87
 
88
89
90
91
 
92
93
94
 
95
96
97
 
98
99
100
101
 
102
103
 
104
105
 
106
107
 
108
109
110
 
111
112
113
114
 
115
116
117
 
118
119
 
120
121
 
122
123
 
124
125
126
 
127
128
129
130
 
131
132
133
 
 
134
135
136
 
137
138
 
139
140
141
 
142
143
144
 
145
146
147
 
 
148
149
150
 
151
152
 
153
154
155
156
 
157
158
 
159
160
 
161
162
 
163
164
165
 
166
167
168
 
169
170
171
 
 
172
173
174
 
175
176
 
177
178
179
 
180
181
182
 
183
184
185
 
186
187
188
 
189
190
191
 
192
193
194
 
195
196
197
 
198
199
200
 
201
202
203
 
204
205
206
 
207
208
209
 
 
210
211
212
 
213
214
 
 
215
216
217
 
218
219
 
220
221
222
223
 
224
225
226
227
228
229
 
230
231
232
233
 
234
235
236
 
237
238
239
240
 
241
242
243
244
245
 
246
247
248
249
 
250
251
252
253
254
 
255
256
257
258
 
 
259
260
261
 
262
263
 
264
265
266
 
 
267
268
269
 
270
271
272
273
274
 
275
276
277
 
278
279
280
281
 
282
283
 
284
285
286
287
0
@@ -76,212 +76,212 @@
0
   });
0
   
0
   new Test.Unit.Runner({
0
- testGetStack: function(){ with(this) {
0
- assertMatch(/prototype_update_helper\.html:\d+\n$/, prototypeUpdateHelper.getStack());
0
- }},
0
+ testGetStack: function() {
0
+ this.assertMatch(/prototype_update_helper\.html:\d+\n$/, prototypeUpdateHelper.getStack());
0
+ },
0
 
0
- testDisplay: function(){ with(this) {
0
+ testDisplay: function()) {
0
       Toggle.display('foo');
0
- assertInfoNotified('Toggle.display has been deprecated, please use Element.toggle instead.');
0
+ this.assertInfoNotified('Toggle.display has been deprecated, please use Element.toggle instead.');
0
         
0
       Element.show('foo', 'bar', 'bla');
0
- assertErrorNotified('Passing an arbitrary number of elements to Element.show is no longer supported.\n' +
0
+ this.assertErrorNotified('Passing an arbitrary number of elements to Element.show is no longer supported.\n' +
0
         'Use [id_1, id_2, ...].each(Element.show) or $(id_1, id_2, ...).invoke("show") instead.');
0
       
0
       $('foo', 'bar', 'bla').each(Element.hide);
0
- assertNotNotified();
0
+ this.assertNotNotified();
0
       
0
       Element.show('foo');
0
- assertNotNotified();
0
+ this.assertNotNotified();
0
       
0
       Element.hide('foo', 'bar', 'bla');
0
- assertErrorNotified('Passing an arbitrary number of elements to Element.hide is no longer supported.\n' +
0
+ this.assertErrorNotified('Passing an arbitrary number of elements to Element.hide is no longer supported.\n' +
0
         'Use [id_1, id_2, ...].each(Element.hide) or $(id_1, id_2, ...).invoke("hide") instead.');
0
       
0
       Element.toggle('foo', 'bar', 'bla');
0
- assertErrorNotified('Passing an arbitrary number of elements to Element.toggle is no longer supported.\n' +
0
+ this.assertErrorNotified('Passing an arbitrary number of elements to Element.toggle is no longer supported.\n' +
0
         'Use [id_1, id_2, ...].each(Element.toggle) or $(id_1, id_2, ...).invoke("toggle") instead.');
0
- }},
0
+ }},
0
     
0
- testElementStyle: function(){ with(this) {
0
+ testElementStyle: function()) {
0
       Element.setStyle('foo', { 'fontSize': '18px' });
0
- assertNotNotified();
0
+ this.assertNotNotified();
0
       
0
       Element.setStyle('foo', { 'font-size': '18px' });
0
- assertErrorNotified('Use of uncamelized style-property names is no longer supported.\n' +
0
+ this.assertErrorNotified('Use of uncamelized style-property names is no longer supported.\n' +
0
         'Use either camelized style-property names or a regular CSS string instead (see online documentation).')
0
       
0
       Element.setStyle('foo', 'font-size: 18px;');
0
- assertNotNotified();
0
+ this.assertNotNotified();
0
       
0
       $('foo').setStyle({ 'font-size': '18px' });
0
- assertErrorNotified('Use of uncamelized style-property names is no longer supported.\n' +
0
+ this.assertErrorNotified('Use of uncamelized style-property names is no longer supported.\n' +
0
         'Use either camelized style-property names or a regular CSS string instead (see online documentation).')
0
- }},
0
+ }},
0
 
0
- testClassNames: function(){ with(this) {
0
+ testClassNames: function()) {
0
       new Element.ClassNames('foo');
0
- assertInfoNotified('Element.ClassNames has been deprecated.')
0
+ this.assertInfoNotified('Element.ClassNames has been deprecated.')
0
       
0
       $('foo').classNames();
0
- assertInfoNotified('Element#classNames has been deprecated.\n' +
0
+ this.assertInfoNotified('Element#classNames has been deprecated.\n' +
0
         'If you need to access CSS class names as an array, try: $w(element.classname).')
0
 
0
       Element.getElementsByClassName('foo', 'className');
0
- assertInfoNotified('Element#getElementsByClassName has been deprecated, please use Element#select instead.')
0
+ this.assertInfoNotified('Element#getElementsByClassName has been deprecated, please use Element#select instead.')
0
       
0
       document.getElementsByClassName('className');
0
- assertInfoNotified('document.getElementsByClassName has been deprecated, please use $$ instead.')
0
- }},
0
+ this.assertInfoNotified('document.getElementsByClassName has been deprecated, please use $$ instead.')
0
+ },
0
     
0
- testDomSelectors: function(){ with(this) {
0
+ testDomSelectors: function()) {
0
       Element.childOf('foo', 'bar');
0
- assertInfoNotified('Element#childOf has been deprecated, please use Element#descendantOf instead.');
0
+ this.assertInfoNotified('Element#childOf has been deprecated, please use Element#descendantOf instead.');
0
 
0
       $('foo').immediateDescendants();
0
- assertInfoNotified('Element#immediateDescendants has been deprecated, please use Element#childElements instead.');
0
+ this.assertInfoNotified('Element#immediateDescendants has been deprecated, please use Element#childElements instead.');
0
       
0
       $('foo').getElementsBySelector('a');
0
- assertInfoNotified('Element#getElementsBySelector has been deprecated, please use Element#select instead.');
0
+ this.assertInfoNotified('Element#getElementsBySelector has been deprecated, please use Element#select instead.');
0
 
0
       $('foo').select('a');
0
- assertNotNotified();
0
- }},
0
+ this.assertNotNotified();
0
+ },
0
     
0
- testField: function(){ with(this) {
0
+ testField: function()) {
0
       Field.clear('foo', 'bar', 'bla');
0
- assertErrorNotified('Passing an arbitrary number of elements to Field.clear is no longer supported.\n' +
0
+ this.assertErrorNotified('Passing an arbitrary number of elements to Field.clear is no longer supported.\n' +
0
         'Use [id_1, id_2, ...].each(Form.Element.clear) or $(id_1, id_2, ...).invoke("clear") instead.');
0
         
0
       Field.present('foo', 'bar', 'bla');
0
- assertErrorNotified('Passing an arbitrary number of elements to Field.present is no longer supported.\n' +
0
+ this.assertErrorNotified('Passing an arbitrary number of elements to Field.present is no longer supported.\n' +
0
         'Use [id_1, id_2, ...].each(Form.Element.present) or $(id_1, id_2, ...).invoke("present") instead.');
0
- }},
0
+ }},
0
     
0
- testInsertion: function(){ with(this) {
0
+ testInsertion: function()) {
0
       Insertion.Before('foo', 'text');
0
- assertInfoNotified('Insertion.Before has been deprecated, please use Element#insert instead.');
0
+ this.assertInfoNotified('Insertion.Before has been deprecated, please use Element#insert instead.');
0
 
0
       Insertion.Top('foo', 'text');
0
- assertInfoNotified('Insertion.Top has been deprecated, please use Element#insert instead.');
0
+ this.assertInfoNotified('Insertion.Top has been deprecated, please use Element#insert instead.');
0
 
0
       Insertion.Bottom('foo', 'text');
0
- assertInfoNotified('Insertion.Bottom has been deprecated, please use Element#insert instead.');
0
+ this.assertInfoNotified('Insertion.Bottom has been deprecated, please use Element#insert instead.');
0
 
0
       Insertion.After('foo', 'text');
0
- assertInfoNotified('Insertion.After has been deprecated, please use Element#insert instead.');
0
- }},
0
+ this.assertInfoNotified('Insertion.After has been deprecated, please use Element#insert instead.');
0
+ },
0
     
0
- testPosition: function(){ with(this) {
0
+ testPosition: function()) {
0
       Position.prepare('foo');
0
- assertInfoNotified('Position.prepare has been deprecated.');
0
+ this.assertInfoNotified('Position.prepare has been deprecated.');
0
 
0
       Position.within('foo');
0
- assertInfoNotified('Position.within has been deprecated.');
0
+ this.assertInfoNotified('Position.within has been deprecated.');
0
 
0
       Position.withinIncludingScrolloffsets('foo');
0
- assertInfoNotified('Position.withinIncludingScrolloffsets has been deprecated.');
0
+ this.assertInfoNotified('Position.withinIncludingScrolloffsets has been deprecated.');
0
 
0
       Position.overlap('foo');
0
- assertInfoNotified('Position.overlap has been deprecated.');
0
+ this.assertInfoNotified('Position.overlap has been deprecated.');
0
 
0
       Position.cumulativeOffset('foo');
0
- assertInfoNotified('Position.cumulativeOffset has been deprecated, please use Element#cumulativeOffset instead.');
0
+ this.assertInfoNotified('Position.cumulativeOffset has been deprecated, please use Element#cumulativeOffset instead.');
0
 
0
       Position.positionedOffset('foo');
0
- assertInfoNotified('Position.positionedOffset has been deprecated, please use Element#positionedOffset instead.');
0
+ this.assertInfoNotified('Position.positionedOffset has been deprecated, please use Element#positionedOffset instead.');
0
 
0
       Position.absolutize('foo');
0
- assertInfoNotified('Position.absolutize has been deprecated, please use Element#absolutize instead.');
0
+ this.assertInfoNotified('Position.absolutize has been deprecated, please use Element#absolutize instead.');
0
 
0
       Position.relativize('foo');
0
- assertInfoNotified('Position.relativize has been deprecated, please use Element#relativize instead.');
0
+ this.assertInfoNotified('Position.relativize has been deprecated, please use Element#relativize instead.');
0
 
0
       Position.realOffset('foo');
0
- assertInfoNotified('Position.realOffset has been deprecated, please use Element#cumulativeScrollOffset instead.');
0
+ this.assertInfoNotified('Position.realOffset has been deprecated, please use Element#cumulativeScrollOffset instead.');
0
 
0
       Position.offsetParent('foo');
0
- assertInfoNotified('Position.offsetParent has been deprecated, please use Element#getOffsetParent instead.');
0
+ this.assertInfoNotified('Position.offsetParent has been deprecated, please use Element#getOffsetParent instead.');
0
 
0
       Position.page('foo');
0
- assertInfoNotified('Position.page has been deprecated, please use Element#viewportOffset instead.');
0
+ this.assertInfoNotified('Position.page has been deprecated, please use Element#viewportOffset instead.');
0
 
0
       Position.clone('foo', 'bar');
0
- assertInfoNotified('Position.clone has been deprecated, please use Element#clonePosition instead.');
0
- }},
0
+ this.assertInfoNotified('Position.clone has been deprecated, please use Element#clonePosition instead.');
0
+ },
0
 
0
- testEvent: function(){ with(this) {
0
+ testEvent: function()) {
0
       Event.unloadCache();
0
- assertErrorNotified('Event.unloadCache has been deprecated.')
0
- }},
0
+ this.assertErrorNotified('Event.unloadCache has been deprecated.')
0
+ },
0
     
0
- testHash: function(){ with(this) {
0
+ testHash: function()) {
0
       Hash.toQueryString({});
0
- assertInfoNotified('Hash.toQueryString has been deprecated.\n' +
0
+ this.assertInfoNotified('Hash.toQueryString has been deprecated.\n' +
0
         'Use the instance method Hash#toQueryString or Object.toQueryString instead.');
0
 
0
      Hash.toJSON({});
0
- assertErrorNotified('Hash.toJSON has been removed.\n' +
0
+ this.assertErrorNotified('Hash.toJSON has been removed.\n' +
0
         'Use the instance method Hash#toJSON or Object.toJSON instead.');
0
       
0
       var h = $H({ foo: 2 });
0
       
0
       h.remove('foo');
0
- assertErrorNotified('Hash#remove is no longer supported, use Hash#unset instead.\n' +
0
+ this.assertErrorNotified('Hash#remove is no longer supported, use Hash#unset instead.\n' +
0
         'Please note that Hash#unset only accepts one argument.');
0
       
0
       h.merge('foo');
0
- assertWarnNotified('Hash#merge is no longer destructive and now operates on a clone of the Hash instance.\n' + 'If you need a destructive merge, use Hash#update instead.');
0
+ this.assertWarnNotified('Hash#merge is no longer destructive and now operates on a clone of the Hash instance.\n' + 'If you need a destructive merge, use Hash#update instead.');
0
       
0
       h['foo'];
0
- assertErrorNotified('Directly accessing a property of an instance of Hash is no longer supported.\n' +
0
+ this.assertErrorNotified('Directly accessing a property of an instance of Hash is no longer supported.\n' +
0
         'Please use Hash#get(\'foo\') instead.')
0
       
0
       h.foo = 3;
0
- assertErrorNotified('Directly setting a property on an instance of Hash is no longer supported.\n' +
0
+ this.assertErrorNotified('Directly setting a property on an instance of Hash is no longer supported.\n' +
0
         'Please use Hash#set(\'foo\', 3) instead.')
0
         
0
       h.bar = 'bar';
0
       h.toJSON();
0
- assertErrorNotified('Directly setting a property on an instance of Hash is no longer supported.\n' +
0
+ this.assertErrorNotified('Directly setting a property on an instance of Hash is no longer supported.\n' +
0
         'Please use Hash#set(\'bar\', \'bar\') instead.')
0
         
0
       h.bar;
0
- assertErrorNotified('Directly accessing a property of an instance of Hash is no longer supported.\n' +
0
+ this.assertErrorNotified('Directly accessing a property of an instance of Hash is no longer supported.\n' +
0
         'Please use Hash#get(\'bar\') instead.')
0
         
0
       h.baz = 'baz';
0
       h.bar;
0
- assertErrorNotified('Directly setting a property on an instance of Hash is no longer supported.\n' +
0
+ this.assertErrorNotified('Directly setting a property on an instance of Hash is no longer supported.\n' +
0
         'Please use Hash#set(\'baz\', \'baz\') instead.')
0
       
0
       h.set('toJSON', 'arg'); // make sure hash methods are not overwritten
0
- assertRespondsTo('toJSON', h)
0
- }},
0
+ this.assertRespondsTo('toJSON', h)
0
+ },
0
 
0
- testClass: function(){ with(this) {
0
+ testClass: function()) {
0
       Class.create();
0
- assertInfoNotified('The class API has been fully revised and now allows for mixins and inheritance.\n' +
0
+ this.assertInfoNotified('The class API has been fully revised and now allows for mixins and inheritance.\n' +
0
         'You can find more about it here: http://prototypejs.org/learn/class-inheritance');
0
       Class.create({});
0
- assertNotNotified();
0
- }},
0
+ this.assertNotNotified();
0
+ },
0
     
0
- testLogDeprecationOption: function(){ with(this) {
0
+ testLogDeprecationOption: function()) {
0
       prototypeUpdateHelper.logLevel = UpdateHelper.Warn;
0
       var h = $H({ foo: 2 });
0
       
0
       h.merge({ foo: 3 });
0
- assertWarnNotified('Hash#merge is no longer destructive and now operates on a clone of the Hash instance.\n' + 'If you need a destructive merge, use Hash#update instead.');
0
+ this.assertWarnNotified('Hash#merge is no longer destructive and now operates on a clone of the Hash instance.\n' + 'If you need a destructive merge, use Hash#update instead.');
0
       
0
       h.remove('foo');
0
- assertErrorNotified('Hash#remove is no longer supported, use Hash#unset instead.\n' +
0
+ this.assertErrorNotified('Hash#remove is no longer supported, use Hash#unset instead.\n' +
0
         'Please note that Hash#unset only accepts one argument.');
0
       
0
       document.getElementsByClassName('className');
0
- assertNotNotified();
0
+ this.assertNotNotified();
0
       prototypeUpdateHelper.logLevel = UpdateHelper.Info;
0
- }}
0
+ }}
0
   });
0
   
0
 </script>
...
81
82
83
84
 
85
86
87
88
89
 
90
91
92
93
94
95
 
 
96
97
 
98
99
100
101
102
103
 
104
105
106
107
 
 
108
109
110
 
 
111
112
113
114
115
116
117
 
118
119
 
120
121
 
122
123
124
 
 
125
126
127
128
129
 
 
130
131
132
 
133
134
135
136
137
138
139
140
141
 
 
 
142
143
144
 
145
146
 
147
148
149
150
 
 
151
152
153
154
 
 
155
156
157
158
159
 
 
160
161
162
163
 
164
165
 
166
167
168
169
170
171
172
173
...
171
172
173
174
175
 
 
176
177
 
178
179
 
180
181
182
183
184
185
186
 
187
188
189
190
 
191
192
193
 
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
...
199
200
201
202
203
 
 
204
205
206
 
 
207
208
209
210
 
 
 
211
212
 
213
214
215
216
 
 
 
217
218
 
219
220
 
221
222
 
223
224
225
 
226
227
 
228
229
 
230
231
232
 
 
233
234
235
236
237
238
 
 
239
240
241
 
242
243
 
244
245
 
246
247
248
 
 
249
250
 
251
252
253
 
 
254
255
256
257
258
259
260
261
 
 
262
263
264
265
...
266
267
268
269
270
 
 
271
272
273
 
274
275
276
277
278
279
...
278
279
280
281
282
 
 
283
284
 
285
286
 
287
288
 
289
290
291
292
293
294
295
296
297
298
299
300
301
...
293
294
295
296
 
297
298
 
299
300
 
301
302
303
304
 
305
306
 
307
308
309
 
 
310
311
312
313
314
 
 
315
316
317
 
318
319
 
320
321
322
 
 
323
324
325
 
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
...
330
331
332
333
 
334
335
336
337
338
339
 
340
341
342
343
344
 
345
346
347
348
349
350
351
352
353
 
 
 
354
355
356
 
357
358
359
360
361
 
362
363
 
364
365
366
 
 
367
368
369
370
371
372
 
 
 
373
374
375
376
377
378
379
 
 
 
380
381
382
 
383
384
 
385
386
387
 
 
388
389
390
391
392
393
 
 
 
394
395
396
 
397
398
 
399
400
401
 
 
402
403
404
405
406
407
408
 
 
 
 
409
410
411
 
412
413
 
414
415
 
416
417
418
419
 
 
 
420
421
 
422
423
424
425
426
427
428
...
427
428
429
430
431
 
 
432
433
434
435
436
437
438
 
 
439
440
441
442
443
444
445
 
 
446
447
448
449
450
 
451
452
 
453
454
455
...
81
82
83
 
84
85
86
87
88
 
89
90
91
92
93
 
 
94
95
96
 
97
98
99
100
101
102
 
103
104
105
 
 
106
107
108
 
 
109
110
111
112
113
114
115
116
 
117
118
 
119
120
 
121
122
 
 
123
124
125
126
127
 
 
128
129
130
131
 
132
133
134
135
136
137
138
 
 
 
139
140
141
142
143
 
144
145
 
146
147
148
 
 
149
150
151
152
 
 
153
154
155
156
157
 
 
158
159
160
161
162
 
163
164
 
165
166
167
168
169
170
171
172
173
...
171
172
173
 
 
174
175
176
 
177
178
 
179
180
181
182
183
184
185
 
186
187
188
189
 
190
191
192
 
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
...
199
200
201
 
 
202
203
204
 
 
205
206
207
 
 
 
208
209
210
211
 
212
213
 
 
 
214
215
216
217
 
218
219
 
220
221
 
222
223
224
 
225
226
 
227
228
 
229
230
 
 
231
232
233
234
235
236
 
 
237
238
239
240
 
241
242
 
243
244
 
245
246
 
 
247
248
249
 
250
251
 
 
252
253
254
255
256
257
258
259
 
 
260
261
262
263
264
265
...
266
267
268
 
 
269
270
271
272
 
273
274
275
276
277
278
279
...
278
279
280
 
 
281
282
283
 
284
285
 
286
287
 
288
289
290
291
292
293
294
295
296
297
298
299
300
301
...
293
294
295
 
296
297
 
298
299
 
300
301
302
303
 
304
305
 
306
307
 
 
308
309
310
311
312
 
 
313
314
315
316
 
317
318
 
319
320
 
 
321
322
323
324
 
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
...
330
331
332
 
333
334
335
336
337
338
 
339
340
341
342
343
 
344
345
346
347
348
349
350
 
 
 
351
352
353
354
355
 
356
357
358
359
360
 
361
362
 
363
364
 
 
365
366
367
368
369
 
 
 
370
371
372
373
374
375
376
 
 
 
377
378
379
380
381
 
382
383
 
384
385
 
 
386
387
388
389
390
 
 
 
391
392
393
394
395
 
396
397
 
398
399
 
 
400
401
402
403
404
 
 
 
 
405
406
407
408
409
410
 
411
412
 
413
414
 
415
416
 
 
 
417
418
419
420
 
421
422
423
424
425
426
427
428
...
427
428
429
 
 
430
431
432
433
434
435
436
 
 
437
438
439
440
441
442
443
 
 
444
445
446
447
448
449
 
450
451
 
452
453
454
455
0
@@ -81,88 +81,88 @@
0
   var message = 'You must be running your tests from rake to test this feature.';
0
   
0
   new Test.Unit.Runner({
0
- setup: function(){
0
+ setup: function() {
0
       $('content').update('');
0
       $('content2').update('');
0
     },
0
     
0
- teardown: function(){
0
+ teardown: function() {
0
       // hack to cleanup responders
0
       Ajax.Responders.responders = [Ajax.Responders.responders[0]];
0
     },
0
     
0
- testSynchronousRequest: function() {with(this) {
0
- assertEqual("", $("content").innerHTML);
0
+ testSynchronousRequest: function() {
0
+ this.assertEqual("", $("content").innerHTML);
0
       
0
- assertEqual(0, Ajax.activeRequestCount);
0
+ this.assertEqual(0, Ajax.activeRequestCount);
0
       new Ajax.Request("fixtures/hello.js", {
0
         asynchronous: false,
0
         method: 'GET',
0
         evalJS: 'force'
0
       });
0
- assertEqual(0, Ajax.activeRequestCount);
0
+ this.assertEqual(0, Ajax.activeRequestCount);
0
       
0
       var h2 = $("content").firstChild;
0
- assertEqual("Hello world!", h2.innerHTML);
0
- }},
0
+ this.assertEqual("Hello world!", h2.innerHTML);
0
+ },
0
     
0
- testAsynchronousRequest: function() {with(this) {
0
- assertEqual("", $("content").innerHTML);
0
+ testAsynchronousRequest: function() {
0
+ this.assertEqual("", $("content").innerHTML);
0
       
0
       new Ajax.Request("fixtures/hello.js", {
0
         asynchronous: true,
0
         method: 'get',
0
         evalJS: 'force'
0
       });
0
- wait(1000, function() {
0
+ this.wait(1000, function() {
0
         var h2 = $("content").firstChild;
0
- assertEqual("Hello world!", h2.innerHTML);
0
+ this.assertEqual("Hello world!", h2.innerHTML);
0
       });
0
- }},
0
+ }},
0
     
0
- testUpdater: function() {with(this) {
0
- assertEqual("", $("content").innerHTML);
0
+ testUpdater: function() {
0
+ this.assertEqual("", $("content").innerHTML);
0
       
0
       new Ajax.Updater("content", "fixtures/content.html", { method:'get' });
0
       
0
- wait(1000, function() {
0
- assertEqual(sentence, $("content").innerHTML.strip().toLowerCase());
0
+ this.wait(1000, function() {
0
+ this.assertEqual(sentence, $("content").innerHTML.strip().toLowerCase());
0
         
0
         $('content').update('');
0
- assertEqual("", $("content").innerHTML);
0
+ this.assertEqual("", $("content").innerHTML);
0
          
0
         new Ajax.Updater({ success:"content", failure:"content2" },
0
           "fixtures/content.html", { method:'get', parameters:{ pet:'monkey' } });
0
         
0
         new Ajax.Updater("", "fixtures/content.html", { method:'get', parameters:"pet=monkey" });
0
         
0
- wait(1000, function() {
0
- assertEqual(sentence, $("content").innerHTML.strip().toLowerCase());
0
- assertEqual("", $("content2").innerHTML);
0
+ this.wait(1000, function() {
0
+ this.assertEqual(sentence, $("content").innerHTML.strip().toLowerCase());
0
+ this.assertEqual("", $("content2").innerHTML);
0
         });
0
       });
0
- }},
0
+ }},
0
     
0
- testUpdaterWithInsertion: function() {with(this) {
0
+ testUpdaterWithInsertion: function() {) {
0
       $('content').update();
0
       new Ajax.Updater("content", "fixtures/content.html", { method:'get', insertion: Insertion.Top });
0
- wait(1000, function() {
0
- assertEqual(sentence, $("content").innerHTML.strip().toLowerCase());
0
+ this.wait(1000, function() {
0
+ this.assertEqual(sentence, $("content").innerHTML.strip().toLowerCase());
0
         $('content').update();
0
         new Ajax.Updater("content", "fixtures/content.html", { metho