transpec 1.10.2 → 1.10.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -37,7 +37,7 @@ module Transpec
37
37
 
38
38
  let(:parenthesize_arg) { true }
39
39
 
40
- context 'when it is `== 1` form' do
40
+ context 'with expression `== 1`' do
41
41
  let(:source) do
42
42
  <<-END
43
43
  describe 'example' do
@@ -58,7 +58,7 @@ module Transpec
58
58
  END
59
59
  end
60
60
 
61
- it 'converts into `eq(1)` form' do
61
+ it 'converts to `eq(1)` form' do
62
62
  rewritten_source.should == expected_source
63
63
  end
64
64
 
@@ -114,7 +114,7 @@ module Transpec
114
114
  end
115
115
  end
116
116
 
117
- context 'when it is `==1` form' do
117
+ context 'with expression `==1`' do
118
118
  let(:source) do
119
119
  <<-END
120
120
  describe 'example' do
@@ -135,7 +135,7 @@ module Transpec
135
135
  END
136
136
  end
137
137
 
138
- it 'converts into `eq(1)` form' do
138
+ it 'converts to `eq(1)` form' do
139
139
  rewritten_source.should == expected_source
140
140
  end
141
141
 
@@ -152,13 +152,13 @@ module Transpec
152
152
  END
153
153
  end
154
154
 
155
- it 'converts into `eq 1` form' do
155
+ it 'converts to `eq 1` form' do
156
156
  rewritten_source.should == expected_source
157
157
  end
158
158
  end
159
159
  end
160
160
 
161
- context 'when it is `be == 1` form' do
161
+ context 'with expression `be == 1`' do
162
162
  let(:source) do
163
163
  <<-END
164
164
  describe 'example' do
@@ -179,7 +179,7 @@ module Transpec
179
179
  END
180
180
  end
181
181
 
182
- it 'converts into `eq(1)` form' do
182
+ it 'converts to `eq(1)` form' do
183
183
  rewritten_source.should == expected_source
184
184
  end
185
185
 
@@ -190,7 +190,7 @@ module Transpec
190
190
  end
191
191
  end
192
192
 
193
- context 'when it is `be.==(1)` form' do
193
+ context 'with expression `be.==(1)`' do
194
194
  let(:source) do
195
195
  <<-END
196
196
  describe 'example' do
@@ -211,12 +211,12 @@ module Transpec
211
211
  END
212
212
  end
213
213
 
214
- it 'converts into `eq(1)` form' do
214
+ it 'converts to `eq(1)` form' do
215
215
  rewritten_source.should == expected_source
216
216
  end
217
217
  end
218
218
 
219
- context 'when it is `== (2 - 1)` form' do
219
+ context 'with expression `== (2 - 1)`' do
220
220
  let(:source) do
221
221
  <<-END
222
222
  describe 'example' do
@@ -237,12 +237,12 @@ module Transpec
237
237
  END
238
238
  end
239
239
 
240
- it 'converts into `eq(2 - 1)` form without superfluous parentheses' do
240
+ it 'converts to `eq(2 - 1)` form without superfluous parentheses' do
241
241
  rewritten_source.should == expected_source
242
242
  end
243
243
  end
244
244
 
245
- context 'when it is `== (5 - 3) / (4 - 2)` form' do
245
+ context 'with expression `== (5 - 3) / (4 - 2)`' do
246
246
  let(:source) do
247
247
  <<-END
248
248
  describe 'example' do
@@ -263,12 +263,12 @@ module Transpec
263
263
  END
264
264
  end
265
265
 
266
- it 'converts into `eq((5 - 3) / (4 - 2))` form' do
266
+ it 'converts to `eq((5 - 3) / (4 - 2))` form' do
267
267
  rewritten_source.should == expected_source
268
268
  end
269
269
  end
270
270
 
271
- context "when it is `== { 'key' => 'value' }` form" do
271
+ context "with expression `== { 'key' => 'value' }`" do
272
272
  let(:source) do
273
273
  <<-END
274
274
  describe 'example' do
@@ -289,7 +289,7 @@ module Transpec
289
289
  END
290
290
  end
291
291
 
292
- it "converts into `eq({ 'key' => 'value' })` form" do
292
+ it "converts to `eq({ 'key' => 'value' })` form" do
293
293
  rewritten_source.should == expected_source
294
294
  end
295
295
 
@@ -309,7 +309,7 @@ module Transpec
309
309
  [:>, 'is greater than'],
310
310
  [:>=, 'is greater than or equals to']
311
311
  ].each do |operator, description|
312
- context "when it is `#{operator} 1` form" do
312
+ context "with expression `#{operator} 1`" do
313
313
  let(:source) do
314
314
  <<-END
315
315
  describe 'example' do
@@ -330,7 +330,7 @@ module Transpec
330
330
  END
331
331
  end
332
332
 
333
- it "converts into `be #{operator} 1` form" do
333
+ it "converts to `be #{operator} 1` form" do
334
334
  rewritten_source.should == expected_source
335
335
  end
336
336
 
@@ -341,7 +341,7 @@ module Transpec
341
341
  end
342
342
  end
343
343
 
344
- context "when it is `be #{operator} 1` form" do
344
+ context "with expression `be #{operator} 1`" do
345
345
  let(:source) do
346
346
  <<-END
347
347
  describe 'example' do
@@ -362,7 +362,7 @@ module Transpec
362
362
  end
363
363
  end
364
364
 
365
- context 'when it is `=~ /pattern/` form' do
365
+ context 'with expression `=~ /pattern/`' do
366
366
  let(:source) do
367
367
  <<-END
368
368
  describe 'example' do
@@ -383,7 +383,7 @@ module Transpec
383
383
  END
384
384
  end
385
385
 
386
- it 'converts into `match(/pattern/)` form' do
386
+ it 'converts to `match(/pattern/)` form' do
387
387
  rewritten_source.should == expected_source
388
388
  end
389
389
 
@@ -394,7 +394,7 @@ module Transpec
394
394
  end
395
395
  end
396
396
 
397
- context 'when it is `=~/pattern/` form' do
397
+ context 'with expression `=~/pattern/`' do
398
398
  let(:source) do
399
399
  <<-END
400
400
  describe 'example' do
@@ -415,12 +415,12 @@ module Transpec
415
415
  END
416
416
  end
417
417
 
418
- it 'converts into `match(/pattern/)` form' do
418
+ it 'converts to `match(/pattern/)` form' do
419
419
  rewritten_source.should == expected_source
420
420
  end
421
421
  end
422
422
 
423
- context 'when it is `be =~ /pattern/` form' do
423
+ context 'with expression `be =~ /pattern/`' do
424
424
  let(:source) do
425
425
  <<-END
426
426
  describe 'example' do
@@ -441,12 +441,12 @@ module Transpec
441
441
  END
442
442
  end
443
443
 
444
- it 'converts into `match(/pattern/)` form' do
444
+ it 'converts to `match(/pattern/)` form' do
445
445
  rewritten_source.should == expected_source
446
446
  end
447
447
  end
448
448
 
449
- context 'when it is `=~ [1, 2]` form' do
449
+ context 'with expression `=~ [1, 2]`' do
450
450
  let(:source) do
451
451
  <<-END
452
452
  describe 'example' do
@@ -467,7 +467,7 @@ module Transpec
467
467
  END
468
468
  end
469
469
 
470
- it 'converts into `match_array([1, 2])` form' do
470
+ it 'converts to `match_array([1, 2])` form' do
471
471
  rewritten_source.should == expected_source
472
472
  end
473
473
 
@@ -478,7 +478,7 @@ module Transpec
478
478
  end
479
479
  end
480
480
 
481
- context 'when it is `=~[1, 2]` form' do
481
+ context 'with expression `=~[1, 2]`' do
482
482
  let(:source) do
483
483
  <<-END
484
484
  describe 'example' do
@@ -499,12 +499,12 @@ module Transpec
499
499
  END
500
500
  end
501
501
 
502
- it 'converts into `match_array([1, 2])` form' do
502
+ it 'converts to `match_array([1, 2])` form' do
503
503
  rewritten_source.should == expected_source
504
504
  end
505
505
  end
506
506
 
507
- context 'when it is `be =~ [1, 2]` form' do
507
+ context 'with expression `be =~ [1, 2]`' do
508
508
  let(:source) do
509
509
  <<-END
510
510
  describe 'example' do
@@ -525,12 +525,12 @@ module Transpec
525
525
  END
526
526
  end
527
527
 
528
- it 'converts into `match_array([1, 2])` form' do
528
+ it 'converts to `match_array([1, 2])` form' do
529
529
  rewritten_source.should == expected_source
530
530
  end
531
531
  end
532
532
 
533
- context 'when it is `=~ variable` form' do
533
+ context 'with expression `=~ variable`' do
534
534
  context 'and runtime type of the variable is array' do
535
535
  include_context 'dynamic analysis objects'
536
536
 
@@ -556,7 +556,7 @@ module Transpec
556
556
  END
557
557
  end
558
558
 
559
- it 'converts into `match_array(variable)` form' do
559
+ it 'converts to `match_array(variable)` form' do
560
560
  rewritten_source.should == expected_source
561
561
  end
562
562
 
@@ -592,7 +592,7 @@ module Transpec
592
592
  END
593
593
  end
594
594
 
595
- it 'converts into `match(variable)` form' do
595
+ it 'converts to `match(variable)` form' do
596
596
  rewritten_source.should == expected_source
597
597
  end
598
598
 
@@ -624,7 +624,7 @@ module Transpec
624
624
  END
625
625
  end
626
626
 
627
- it 'converts into `match(variable)` form' do
627
+ it 'converts to `match(variable)` form' do
628
628
  rewritten_source.should == expected_source
629
629
  end
630
630
 
@@ -640,7 +640,7 @@ module Transpec
640
640
  end
641
641
  end
642
642
 
643
- context 'when it is `be =~ variable` form' do
643
+ context 'with expression `be =~ variable`' do
644
644
  context 'and no runtime type information is provided' do
645
645
  let(:source) do
646
646
  <<-END
@@ -662,7 +662,7 @@ module Transpec
662
662
  END
663
663
  end
664
664
 
665
- it 'converts into `match(variable)` form' do
665
+ it 'converts to `match(variable)` form' do
666
666
  rewritten_source.should == expected_source
667
667
  end
668
668
 
@@ -70,7 +70,7 @@ module Transpec
70
70
  pending_object.convert_deprecated_syntax!
71
71
  end
72
72
 
73
- context 'when it is `pending` form' do
73
+ context 'with expression `pending`' do
74
74
  let(:source) do
75
75
  <<-END
76
76
  describe 'example' do
@@ -91,7 +91,7 @@ module Transpec
91
91
  END
92
92
  end
93
93
 
94
- it 'converts into `skip` form' do
94
+ it 'converts to `skip` form' do
95
95
  rewritten_source.should == expected_source
96
96
  end
97
97
 
@@ -101,7 +101,7 @@ module Transpec
101
101
  end
102
102
  end
103
103
 
104
- context "when it is `pending 'some reason'` form" do
104
+ context "with expression `pending 'some reason'`" do
105
105
  let(:source) do
106
106
  <<-END
107
107
  describe 'example' do
@@ -122,7 +122,7 @@ module Transpec
122
122
  END
123
123
  end
124
124
 
125
- it "converts into `skip 'some reason` form" do
125
+ it "converts to `skip 'some reason` form" do
126
126
  rewritten_source.should == expected_source
127
127
  end
128
128
 
@@ -132,7 +132,7 @@ module Transpec
132
132
  end
133
133
  end
134
134
 
135
- context 'when it is singleline `pending { do_something_fail }` form' do
135
+ context 'with expression singleline `pending { do_something_fail }`' do
136
136
  let(:source) do
137
137
  <<-END
138
138
  describe 'example' do
@@ -154,7 +154,7 @@ module Transpec
154
154
  END
155
155
  end
156
156
 
157
- it 'converts into `pending; do_something_fail` form' do
157
+ it 'converts to `pending; do_something_fail` form' do
158
158
  rewritten_source.should == expected_source
159
159
  end
160
160
 
@@ -164,7 +164,7 @@ module Transpec
164
164
  end
165
165
  end
166
166
 
167
- context "when it is singleline `pending('some reason') { do_something_fail }` form" do
167
+ context "with expression singleline `pending('some reason') { do_something_fail }`" do
168
168
  let(:source) do
169
169
  <<-END
170
170
  describe 'example' do
@@ -186,12 +186,12 @@ module Transpec
186
186
  END
187
187
  end
188
188
 
189
- it "converts into `pending('some reason'); do_something_fail` form" do
189
+ it "converts to `pending('some reason'); do_something_fail` form" do
190
190
  rewritten_source.should == expected_source
191
191
  end
192
192
  end
193
193
 
194
- context 'when it is multiline `pending { do_something_fail }` form' do
194
+ context 'with expression multiline `pending { do_something_fail }`' do
195
195
  let(:source) do
196
196
  <<-END
197
197
  describe 'example' do
@@ -217,12 +217,12 @@ module Transpec
217
217
  END
218
218
  end
219
219
 
220
- it 'converts into `pending; do_something_fail` form' do
220
+ it 'converts to `pending; do_something_fail` form' do
221
221
  rewritten_source.should == expected_source
222
222
  end
223
223
  end
224
224
 
225
- context "when it is multiline `pending('some reason') { do_something_fail }` form" do
225
+ context "with expression multiline `pending('some reason') { do_something_fail }`" do
226
226
  let(:source) do
227
227
  <<-END
228
228
  describe 'example' do
@@ -248,12 +248,12 @@ module Transpec
248
248
  END
249
249
  end
250
250
 
251
- it "converts into `pending('some reason'); do_something_fail` form" do
251
+ it "converts to `pending('some reason'); do_something_fail` form" do
252
252
  rewritten_source.should == expected_source
253
253
  end
254
254
  end
255
255
 
256
- context 'when it is multiline `pending { do_something_fail }` form ' \
256
+ context 'with expression multiline `pending { do_something_fail }` ' \
257
257
  'but the body is not indented' do
258
258
  let(:source) do
259
259
  <<-END
@@ -280,12 +280,12 @@ module Transpec
280
280
  END
281
281
  end
282
282
 
283
- it 'converts into `pending; do_something_fail` form' do
283
+ it 'converts to `pending; do_something_fail` form' do
284
284
  rewritten_source.should == expected_source
285
285
  end
286
286
  end
287
287
 
288
- context 'when it is multiline `pending { do_something_fail }` form ' \
288
+ context 'with expression multiline `pending { do_something_fail }` ' \
289
289
  'but the body is outdented' do
290
290
  let(:source) do
291
291
  <<-END
@@ -312,12 +312,12 @@ module Transpec
312
312
  END
313
313
  end
314
314
 
315
- it 'converts into `pending; do_something_fail` form' do
315
+ it 'converts to `pending; do_something_fail` form' do
316
316
  rewritten_source.should == expected_source
317
317
  end
318
318
  end
319
319
 
320
- context 'when it is multiline `pending { do_something_fail }` form ' \
320
+ context 'with expression multiline `pending { do_something_fail }` ' \
321
321
  'but anomalistically the beginning and the body of block are same line' do
322
322
  let(:source) do
323
323
  <<-END
@@ -341,12 +341,12 @@ module Transpec
341
341
  END
342
342
  end
343
343
 
344
- it 'converts into `pending; do_something_fail` form' do
344
+ it 'converts to `pending; do_something_fail` form' do
345
345
  rewritten_source.should == expected_source
346
346
  end
347
347
  end
348
348
 
349
- context 'when it is multiline `pending { do_something_fail }` form ' \
349
+ context 'with expression multiline `pending { do_something_fail }` ' \
350
350
  'but anomalistically the body and the end of block are same line' do
351
351
  let(:source) do
352
352
  <<-END
@@ -370,7 +370,7 @@ module Transpec
370
370
  END
371
371
  end
372
372
 
373
- it 'converts into `pending; do_something_fail` form' do
373
+ it 'converts to `pending; do_something_fail` form' do
374
374
  rewritten_source.should == expected_source
375
375
  end
376
376
  end
@@ -19,7 +19,7 @@ module Transpec
19
19
  raise_error_object.remove_error_specification_with_negative_expectation!
20
20
  end
21
21
 
22
- context 'when it is `lambda { }.should raise_error(SpecificErrorClass)` form' do
22
+ context 'with expression `lambda { }.should raise_error(SpecificErrorClass)`' do
23
23
  let(:source) do
24
24
  <<-END
25
25
  describe 'example' do
@@ -41,7 +41,7 @@ module Transpec
41
41
  end
42
42
  end
43
43
 
44
- context 'when it is `expect { }.to raise_error(SpecificErrorClass)` form' do
44
+ context 'with expression `expect { }.to raise_error(SpecificErrorClass)`' do
45
45
  let(:source) do
46
46
  <<-END
47
47
  describe 'example' do
@@ -63,7 +63,7 @@ module Transpec
63
63
  end
64
64
  end
65
65
 
66
- context 'when it is `lambda { }.should raise_error(SpecificErrorClass) { |error| ... }` form' do
66
+ context 'with expression `lambda { }.should raise_error(SpecificErrorClass) { |error| ... }`' do
67
67
  let(:source) do
68
68
  <<-END
69
69
  describe 'example' do
@@ -85,7 +85,7 @@ module Transpec
85
85
  end
86
86
  end
87
87
 
88
- context 'when it is `expect { }.to raise_error(SpecificErrorClass) { |error| ... }` form' do
88
+ context 'with expression `expect { }.to raise_error(SpecificErrorClass) { |error| ... }`' do
89
89
  let(:source) do
90
90
  <<-END
91
91
  describe 'example' do
@@ -107,7 +107,7 @@ module Transpec
107
107
  end
108
108
  end
109
109
 
110
- context 'when it is `expect { }.to raise_error(SpecificErrorClass).with_message(message)` form' do
110
+ context 'with expression `expect { }.to raise_error(SpecificErrorClass).with_message(message)`' do
111
111
  let(:source) do
112
112
  <<-END
113
113
  describe 'example' do
@@ -129,7 +129,7 @@ module Transpec
129
129
  end
130
130
  end
131
131
 
132
- context 'when it is `lambda { }.should_not raise_error(SpecificErrorClass)` form' do
132
+ context 'with expression `lambda { }.should_not raise_error(SpecificErrorClass)`' do
133
133
  let(:source) do
134
134
  <<-END
135
135
  describe 'example' do
@@ -152,7 +152,7 @@ module Transpec
152
152
 
153
153
  let(:raise_error_object) { should_object.raise_error_matcher }
154
154
 
155
- it 'converts into `lambda { }.should_not raise_error` form' do
155
+ it 'converts to `lambda { }.should_not raise_error` form' do
156
156
  rewritten_source.should == expected_source
157
157
  end
158
158
 
@@ -163,7 +163,7 @@ module Transpec
163
163
  end
164
164
  end
165
165
 
166
- context 'when it is `expect { }.not_to raise_error(SpecificErrorClass)` form' do
166
+ context 'with expression `expect { }.not_to raise_error(SpecificErrorClass)`' do
167
167
  let(:source) do
168
168
  <<-END
169
169
  describe 'example' do
@@ -186,12 +186,12 @@ module Transpec
186
186
 
187
187
  let(:raise_error_object) { expect_object.raise_error_matcher }
188
188
 
189
- it 'converts into `expect { }.not_to raise_error` form' do
189
+ it 'converts to `expect { }.not_to raise_error` form' do
190
190
  rewritten_source.should == expected_source
191
191
  end
192
192
  end
193
193
 
194
- context 'when it is `expect { }.to_not raise_error(SpecificErrorClass)` form' do
194
+ context 'with expression `expect { }.to_not raise_error(SpecificErrorClass)`' do
195
195
  let(:source) do
196
196
  <<-END
197
197
  describe 'example' do
@@ -214,7 +214,7 @@ module Transpec
214
214
 
215
215
  let(:raise_error_object) { expect_object.raise_error_matcher }
216
216
 
217
- it 'converts into `expect { }.to_not raise_error` form' do
217
+ it 'converts to `expect { }.to_not raise_error` form' do
218
218
  rewritten_source.should == expected_source
219
219
  end
220
220
 
@@ -225,7 +225,7 @@ module Transpec
225
225
  end
226
226
  end
227
227
 
228
- context 'when it is `expect { }.not_to raise_error SpecificErrorClass` form' do
228
+ context 'with expression `expect { }.not_to raise_error SpecificErrorClass`' do
229
229
  let(:source) do
230
230
  <<-END
231
231
  describe 'example' do
@@ -248,7 +248,7 @@ module Transpec
248
248
 
249
249
  let(:raise_error_object) { expect_object.raise_error_matcher }
250
250
 
251
- it 'converts into `expect { }.not_to raise_error` form' do
251
+ it 'converts to `expect { }.not_to raise_error` form' do
252
252
  rewritten_source.should == expected_source
253
253
  end
254
254
 
@@ -259,7 +259,7 @@ module Transpec
259
259
  end
260
260
  end
261
261
 
262
- context 'when it is `expect { }.not_to raise_error(SpecificErrorClass, message)` form' do
262
+ context 'with expression `expect { }.not_to raise_error(SpecificErrorClass, message)`' do
263
263
  let(:source) do
264
264
  <<-END
265
265
  describe 'example' do
@@ -282,7 +282,7 @@ module Transpec
282
282
 
283
283
  let(:raise_error_object) { expect_object.raise_error_matcher }
284
284
 
285
- it 'converts into `expect { }.not_to raise_error` form' do
285
+ it 'converts to `expect { }.not_to raise_error` form' do
286
286
  rewritten_source.should == expected_source
287
287
  end
288
288
 
@@ -293,7 +293,7 @@ module Transpec
293
293
  end
294
294
  end
295
295
 
296
- context 'when it is `expect { }.not_to raise_error(message)` form' do
296
+ context 'with expression `expect { }.not_to raise_error(message)`' do
297
297
  let(:source) do
298
298
  <<-END
299
299
  describe 'example' do
@@ -316,7 +316,7 @@ module Transpec
316
316
 
317
317
  let(:raise_error_object) { expect_object.raise_error_matcher }
318
318
 
319
- it 'converts into `expect { }.not_to raise_error` form' do
319
+ it 'converts to `expect { }.not_to raise_error` form' do
320
320
  rewritten_source.should == expected_source
321
321
  end
322
322