transpec 1.10.2 → 1.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -1
- data/Guardfile +2 -2
- data/README.md +2 -1
- data/README.md.erb +2 -1
- data/lib/transpec/cli.rb +23 -7
- data/lib/transpec/conversion_error.rb +1 -1
- data/lib/transpec/dynamic_analyzer.rb +21 -11
- data/lib/transpec/file_finder.rb +1 -1
- data/lib/transpec/version.rb +1 -1
- data/spec/transpec/cli_spec.rb +22 -0
- data/spec/transpec/dynamic_analyzer_spec.rb +2 -2
- data/spec/transpec/syntax/be_boolean_spec.rb +9 -9
- data/spec/transpec/syntax/be_close_spec.rb +2 -2
- data/spec/transpec/syntax/current_example_spec.rb +13 -13
- data/spec/transpec/syntax/double_spec.rb +3 -3
- data/spec/transpec/syntax/example_spec.rb +14 -14
- data/spec/transpec/syntax/have_spec.rb +41 -41
- data/spec/transpec/syntax/its_spec.rb +16 -16
- data/spec/transpec/syntax/matcher_definition_spec.rb +2 -2
- data/spec/transpec/syntax/method_stub_spec.rb +47 -47
- data/spec/transpec/syntax/oneliner_should_spec.rb +28 -28
- data/spec/transpec/syntax/operator_spec.rb +36 -36
- data/spec/transpec/syntax/pending_spec.rb +20 -20
- data/spec/transpec/syntax/raise_error_spec.rb +17 -17
- data/spec/transpec/syntax/receive_spec.rb +28 -28
- data/spec/transpec/syntax/rspec_configure_spec.rb +1 -1
- data/spec/transpec/syntax/should_receive_spec.rb +48 -48
- data/spec/transpec/syntax/should_spec.rb +15 -15
- data/transpec.gemspec +2 -1
- metadata +18 -4
@@ -154,7 +154,7 @@ module Transpec
|
|
154
154
|
describe '#hash_arg?' do
|
155
155
|
subject { method_stub_object.hash_arg? }
|
156
156
|
|
157
|
-
context '
|
157
|
+
context 'with expression `obj.stub(:message => value)`' do
|
158
158
|
let(:source) do
|
159
159
|
<<-END
|
160
160
|
describe 'example' do
|
@@ -168,7 +168,7 @@ module Transpec
|
|
168
168
|
it { should be_true }
|
169
169
|
end
|
170
170
|
|
171
|
-
context '
|
171
|
+
context 'with expression `obj.stub(:message)`' do
|
172
172
|
let(:source) do
|
173
173
|
<<-END
|
174
174
|
describe 'example' do
|
@@ -190,7 +190,7 @@ module Transpec
|
|
190
190
|
|
191
191
|
let(:rspec_version) { Transpec.required_rspec_version }
|
192
192
|
|
193
|
-
context '
|
193
|
+
context 'with expression `obj.stub(:message)`' do
|
194
194
|
let(:source) do
|
195
195
|
<<-END
|
196
196
|
describe 'example' do
|
@@ -211,7 +211,7 @@ module Transpec
|
|
211
211
|
END
|
212
212
|
end
|
213
213
|
|
214
|
-
it 'converts
|
214
|
+
it 'converts to `allow(obj).to receive(:message)` form' do
|
215
215
|
rewritten_source.should == expected_source
|
216
216
|
end
|
217
217
|
|
@@ -223,7 +223,7 @@ module Transpec
|
|
223
223
|
context 'with runtime information' do
|
224
224
|
include_context 'dynamic analysis objects'
|
225
225
|
|
226
|
-
it 'converts
|
226
|
+
it 'converts to `allow(obj).to receive(:message)` form' do
|
227
227
|
rewritten_source.should == expected_source
|
228
228
|
end
|
229
229
|
end
|
@@ -297,7 +297,7 @@ module Transpec
|
|
297
297
|
end
|
298
298
|
end
|
299
299
|
|
300
|
-
context '
|
300
|
+
context 'with expression `obj.stub!(:message)`' do
|
301
301
|
let(:source) do
|
302
302
|
<<-END
|
303
303
|
describe 'example' do
|
@@ -318,7 +318,7 @@ module Transpec
|
|
318
318
|
END
|
319
319
|
end
|
320
320
|
|
321
|
-
it 'converts
|
321
|
+
it 'converts to `allow(obj).to receive(:message)` form' do
|
322
322
|
rewritten_source.should == expected_source
|
323
323
|
end
|
324
324
|
|
@@ -328,7 +328,7 @@ module Transpec
|
|
328
328
|
end
|
329
329
|
end
|
330
330
|
|
331
|
-
context '
|
331
|
+
context 'with expression `obj.stub(:message).and_return(value)`' do
|
332
332
|
let(:source) do
|
333
333
|
<<-END
|
334
334
|
describe 'example' do
|
@@ -349,12 +349,12 @@ module Transpec
|
|
349
349
|
END
|
350
350
|
end
|
351
351
|
|
352
|
-
it 'converts
|
352
|
+
it 'converts to `allow(obj).to receive(:message).and_return(value)` form' do
|
353
353
|
rewritten_source.should == expected_source
|
354
354
|
end
|
355
355
|
end
|
356
356
|
|
357
|
-
context '
|
357
|
+
context 'with expression `obj.stub(:message).and_raise(RuntimeError)`' do
|
358
358
|
let(:source) do
|
359
359
|
<<-END
|
360
360
|
describe 'example' do
|
@@ -375,7 +375,7 @@ module Transpec
|
|
375
375
|
END
|
376
376
|
end
|
377
377
|
|
378
|
-
it 'converts
|
378
|
+
it 'converts to `allow(obj).to receive(:message).and_raise(RuntimeError)` form' do
|
379
379
|
rewritten_source.should == expected_source
|
380
380
|
end
|
381
381
|
end
|
@@ -416,7 +416,7 @@ module Transpec
|
|
416
416
|
end
|
417
417
|
end
|
418
418
|
|
419
|
-
context '
|
419
|
+
context 'with expression `obj.stub(:message => value)`' do
|
420
420
|
context 'and #receive_messages is available' do
|
421
421
|
# #before here does not work because #allowized! is invoked in super #before.
|
422
422
|
let(:rspec_version) do
|
@@ -445,7 +445,7 @@ module Transpec
|
|
445
445
|
END
|
446
446
|
end
|
447
447
|
|
448
|
-
it 'converts
|
448
|
+
it 'converts to `allow(obj).to receive_messages(:message => value)` form' do
|
449
449
|
rewritten_source.should == expected_source
|
450
450
|
end
|
451
451
|
|
@@ -477,7 +477,7 @@ module Transpec
|
|
477
477
|
END
|
478
478
|
end
|
479
479
|
|
480
|
-
it 'converts
|
480
|
+
it 'converts to `allow(obj).to receive(:message).and_return(value)` form' do
|
481
481
|
rewritten_source.should == expected_source
|
482
482
|
end
|
483
483
|
|
@@ -489,7 +489,7 @@ module Transpec
|
|
489
489
|
end
|
490
490
|
end
|
491
491
|
|
492
|
-
context '
|
492
|
+
context 'with expression `obj.stub(method: value)`' do
|
493
493
|
let(:source) do
|
494
494
|
<<-END
|
495
495
|
describe 'example' do
|
@@ -510,7 +510,7 @@ module Transpec
|
|
510
510
|
END
|
511
511
|
end
|
512
512
|
|
513
|
-
it 'converts
|
513
|
+
it 'converts to `allow(obj).to receive(:message).and_return(value)` form' do
|
514
514
|
rewritten_source.should == expected_source
|
515
515
|
end
|
516
516
|
|
@@ -521,7 +521,7 @@ module Transpec
|
|
521
521
|
end
|
522
522
|
end
|
523
523
|
|
524
|
-
context '
|
524
|
+
context 'with expression `obj.stub(:a_method => a_value, b_method => b_value)`' do
|
525
525
|
let(:source) do
|
526
526
|
<<-END
|
527
527
|
describe 'example' do
|
@@ -543,8 +543,8 @@ module Transpec
|
|
543
543
|
END
|
544
544
|
end
|
545
545
|
|
546
|
-
it 'converts
|
547
|
-
'and `allow(
|
546
|
+
it 'converts to `allow(obj).to receive(:a_method).and_return(a_value)` ' \
|
547
|
+
'and `allow(obj).to receive(:b_method).and_return(b_value)`' do
|
548
548
|
rewritten_source.should == expected_source
|
549
549
|
end
|
550
550
|
|
@@ -631,7 +631,7 @@ module Transpec
|
|
631
631
|
end
|
632
632
|
end
|
633
633
|
|
634
|
-
context '
|
634
|
+
context 'with expression `obj.stub_chain(:foo, :bar => value)`' do
|
635
635
|
let(:source) do
|
636
636
|
<<-END
|
637
637
|
describe 'example' do
|
@@ -660,7 +660,7 @@ module Transpec
|
|
660
660
|
rspec_version
|
661
661
|
end
|
662
662
|
|
663
|
-
it 'converts
|
663
|
+
it 'converts to `allow(obj).to receive_message_chain(:foo, :bar => value)` form' do
|
664
664
|
rewritten_source.should == expected_source
|
665
665
|
end
|
666
666
|
|
@@ -679,7 +679,7 @@ module Transpec
|
|
679
679
|
end
|
680
680
|
|
681
681
|
[:unstub, :unstub!].each do |method|
|
682
|
-
context "
|
682
|
+
context "with expression `obj.#{method}(:message)`" do
|
683
683
|
let(:source) do
|
684
684
|
<<-END
|
685
685
|
describe 'example' do
|
@@ -700,7 +700,7 @@ module Transpec
|
|
700
700
|
end
|
701
701
|
end
|
702
702
|
|
703
|
-
context '
|
703
|
+
context 'with expression `Klass.any_instance.stub(:message)`' do
|
704
704
|
let(:source) do
|
705
705
|
<<-END
|
706
706
|
describe 'example' do
|
@@ -721,7 +721,7 @@ module Transpec
|
|
721
721
|
END
|
722
722
|
end
|
723
723
|
|
724
|
-
it 'converts
|
724
|
+
it 'converts to `allow_any_instance_of(Klass).to receive(:message)` form' do
|
725
725
|
rewritten_source.should == expected_source
|
726
726
|
end
|
727
727
|
|
@@ -771,7 +771,7 @@ module Transpec
|
|
771
771
|
end
|
772
772
|
end
|
773
773
|
|
774
|
-
context '
|
774
|
+
context 'with expression `described_class.any_instance.stub(:message)`' do
|
775
775
|
let(:source) do
|
776
776
|
<<-END
|
777
777
|
describe 'example' do
|
@@ -792,7 +792,7 @@ module Transpec
|
|
792
792
|
END
|
793
793
|
end
|
794
794
|
|
795
|
-
it 'converts
|
795
|
+
it 'converts to `allow_any_instance_of(described_class).to receive(:message)` form' do
|
796
796
|
rewritten_source.should == expected_source
|
797
797
|
end
|
798
798
|
|
@@ -803,7 +803,7 @@ module Transpec
|
|
803
803
|
end
|
804
804
|
end
|
805
805
|
|
806
|
-
context '
|
806
|
+
context 'with expression `variable.any_instance.stub(:message)` ' \
|
807
807
|
'and the variable is an AnyInstance::Recorder' do
|
808
808
|
context 'with runtime information' do
|
809
809
|
include_context 'dynamic analysis objects'
|
@@ -830,7 +830,7 @@ module Transpec
|
|
830
830
|
END
|
831
831
|
end
|
832
832
|
|
833
|
-
it 'converts
|
833
|
+
it 'converts to `allow_any_instance_of(Klass).to receive(:message)` form' do
|
834
834
|
rewritten_source.should == expected_source
|
835
835
|
end
|
836
836
|
|
@@ -843,7 +843,7 @@ module Transpec
|
|
843
843
|
end
|
844
844
|
|
845
845
|
[:unstub, :unstub!].each do |method|
|
846
|
-
context "
|
846
|
+
context "with expression `Klass.any_instance.#{method}(:message)`" do
|
847
847
|
let(:source) do
|
848
848
|
<<-END
|
849
849
|
describe 'example' do
|
@@ -874,7 +874,7 @@ module Transpec
|
|
874
874
|
[:stub!, :stub, 'responds to'],
|
875
875
|
[:unstub!, :unstub, 'does not respond to']
|
876
876
|
].each do |method, replacement_method, description|
|
877
|
-
context "
|
877
|
+
context "with expression `obj.#{method}(:message)`" do
|
878
878
|
let(:source) do
|
879
879
|
<<-END
|
880
880
|
describe 'example' do
|
@@ -895,11 +895,11 @@ module Transpec
|
|
895
895
|
END
|
896
896
|
end
|
897
897
|
|
898
|
-
it "
|
898
|
+
it "converts to `obj.##{replacement_method}(:message)`" do
|
899
899
|
rewritten_source.should == expected_source
|
900
900
|
end
|
901
901
|
|
902
|
-
it 'adds record '
|
902
|
+
it 'adds record ' \
|
903
903
|
"`obj.#{method}(:message)` -> `obj.#{replacement_method}(:message)`" do
|
904
904
|
record.original_syntax.should == "obj.#{method}(:message)"
|
905
905
|
record.converted_syntax.should == "obj.#{replacement_method}(:message)"
|
@@ -911,7 +911,7 @@ module Transpec
|
|
911
911
|
[:stub, 'responds to'],
|
912
912
|
[:unstub, 'does not respond to']
|
913
913
|
].each do |method, description|
|
914
|
-
context "
|
914
|
+
context "with expression `obj.#{method}(:message)`" do
|
915
915
|
let(:source) do
|
916
916
|
<<-END
|
917
917
|
describe 'example' do
|
@@ -936,7 +936,7 @@ module Transpec
|
|
936
936
|
describe '#allow_no_message?' do
|
937
937
|
subject { method_stub_object.allow_no_message? }
|
938
938
|
|
939
|
-
context '
|
939
|
+
context 'with expression `obj.stub(:message).any_number_of_times`' do
|
940
940
|
let(:source) do
|
941
941
|
<<-END
|
942
942
|
describe 'example' do
|
@@ -950,7 +950,7 @@ module Transpec
|
|
950
950
|
it { should be_true }
|
951
951
|
end
|
952
952
|
|
953
|
-
context '
|
953
|
+
context 'with expression `obj.stub(:message).with(arg).any_number_of_times`' do
|
954
954
|
let(:source) do
|
955
955
|
<<-END
|
956
956
|
describe 'example' do
|
@@ -964,7 +964,7 @@ module Transpec
|
|
964
964
|
it { should be_true }
|
965
965
|
end
|
966
966
|
|
967
|
-
context '
|
967
|
+
context 'with expression `obj.stub(:message).at_least(0)`' do
|
968
968
|
let(:source) do
|
969
969
|
<<-END
|
970
970
|
describe 'example' do
|
@@ -978,7 +978,7 @@ module Transpec
|
|
978
978
|
it { should be_true }
|
979
979
|
end
|
980
980
|
|
981
|
-
context '
|
981
|
+
context 'with expression `obj.stub(:message)`' do
|
982
982
|
let(:source) do
|
983
983
|
<<-END
|
984
984
|
describe 'example' do
|
@@ -998,7 +998,7 @@ module Transpec
|
|
998
998
|
method_stub_object.remove_no_message_allowance!
|
999
999
|
end
|
1000
1000
|
|
1001
|
-
context '
|
1001
|
+
context 'with expression `obj.stub(:message).any_number_of_times`' do
|
1002
1002
|
let(:source) do
|
1003
1003
|
<<-END
|
1004
1004
|
describe 'example' do
|
@@ -1030,7 +1030,7 @@ module Transpec
|
|
1030
1030
|
end
|
1031
1031
|
end
|
1032
1032
|
|
1033
|
-
context '
|
1033
|
+
context 'with expression `obj.stub(:message).at_least(0)`' do
|
1034
1034
|
let(:source) do
|
1035
1035
|
<<-END
|
1036
1036
|
describe 'example' do
|
@@ -1062,7 +1062,7 @@ module Transpec
|
|
1062
1062
|
end
|
1063
1063
|
end
|
1064
1064
|
|
1065
|
-
context '
|
1065
|
+
context 'with expression `obj.stub(:message)`' do
|
1066
1066
|
let(:source) do
|
1067
1067
|
<<-END
|
1068
1068
|
describe 'example' do
|
@@ -1084,7 +1084,7 @@ module Transpec
|
|
1084
1084
|
method_stub_object.remove_useless_and_return!
|
1085
1085
|
end
|
1086
1086
|
|
1087
|
-
context '
|
1087
|
+
context 'with expression `obj.stub(:message).and_return { value }`' do
|
1088
1088
|
let(:source) do
|
1089
1089
|
<<-END
|
1090
1090
|
describe 'example' do
|
@@ -1105,7 +1105,7 @@ module Transpec
|
|
1105
1105
|
END
|
1106
1106
|
end
|
1107
1107
|
|
1108
|
-
it 'converts
|
1108
|
+
it 'converts to `obj.stub(:message) { value }` form' do
|
1109
1109
|
rewritten_source.should == expected_source
|
1110
1110
|
end
|
1111
1111
|
|
@@ -1115,7 +1115,7 @@ module Transpec
|
|
1115
1115
|
end
|
1116
1116
|
end
|
1117
1117
|
|
1118
|
-
context '
|
1118
|
+
context 'with expression `obj.stub(:message).and_return`' do
|
1119
1119
|
let(:source) do
|
1120
1120
|
<<-END
|
1121
1121
|
describe 'example' do
|
@@ -1136,7 +1136,7 @@ module Transpec
|
|
1136
1136
|
END
|
1137
1137
|
end
|
1138
1138
|
|
1139
|
-
it 'converts
|
1139
|
+
it 'converts to `obj.stub(:message)` form' do
|
1140
1140
|
rewritten_source.should == expected_source
|
1141
1141
|
end
|
1142
1142
|
|
@@ -1146,7 +1146,7 @@ module Transpec
|
|
1146
1146
|
end
|
1147
1147
|
end
|
1148
1148
|
|
1149
|
-
context '
|
1149
|
+
context 'with expression `obj.stub(:message).and_return(value)`' do
|
1150
1150
|
let(:source) do
|
1151
1151
|
<<-END
|
1152
1152
|
describe 'example' do
|
@@ -1169,7 +1169,7 @@ module Transpec
|
|
1169
1169
|
method_stub_object.add_receiver_arg_to_any_instance_implementation_block!
|
1170
1170
|
end
|
1171
1171
|
|
1172
|
-
context '
|
1172
|
+
context 'with expression `Klass.any_instance.stub(:message) do |arg| .. end`' do
|
1173
1173
|
let(:source) do
|
1174
1174
|
<<-END
|
1175
1175
|
describe 'example' do
|
@@ -1192,7 +1192,7 @@ module Transpec
|
|
1192
1192
|
END
|
1193
1193
|
end
|
1194
1194
|
|
1195
|
-
it 'converts
|
1195
|
+
it 'converts to `Klass.any_instance.stub(:message) do |instance, arg| .. end` form' do
|
1196
1196
|
rewritten_source.should == expected_source
|
1197
1197
|
end
|
1198
1198
|
|
@@ -152,7 +152,7 @@ module Transpec
|
|
152
152
|
end
|
153
153
|
end
|
154
154
|
|
155
|
-
context '
|
155
|
+
context 'with expression `it { should be true }`' do
|
156
156
|
let(:source) do
|
157
157
|
<<-END
|
158
158
|
describe 'example' do
|
@@ -169,7 +169,7 @@ module Transpec
|
|
169
169
|
END
|
170
170
|
end
|
171
171
|
|
172
|
-
it 'converts
|
172
|
+
it 'converts to `it { is_expected.to be true }` form' do
|
173
173
|
should_object.expectize!
|
174
174
|
rewritten_source.should == expected_source
|
175
175
|
end
|
@@ -181,7 +181,7 @@ module Transpec
|
|
181
181
|
end
|
182
182
|
end
|
183
183
|
|
184
|
-
context '
|
184
|
+
context 'with expression `it { should() == 1 }`' do
|
185
185
|
let(:source) do
|
186
186
|
<<-END
|
187
187
|
describe 'example' do
|
@@ -198,7 +198,7 @@ module Transpec
|
|
198
198
|
END
|
199
199
|
end
|
200
200
|
|
201
|
-
it 'converts
|
201
|
+
it 'converts to `it { is_expected.to eq(1) }` form' do
|
202
202
|
should_object.expectize!
|
203
203
|
rewritten_source.should == expected_source
|
204
204
|
end
|
@@ -258,7 +258,7 @@ module Transpec
|
|
258
258
|
|
259
259
|
include_examples 'does not convert if project requires have(n).items matcher'
|
260
260
|
|
261
|
-
context '
|
261
|
+
context 'with expression `it { should have(2).items }`' do
|
262
262
|
let(:source) do
|
263
263
|
<<-END
|
264
264
|
describe 'example' do
|
@@ -277,7 +277,7 @@ module Transpec
|
|
277
277
|
END
|
278
278
|
end
|
279
279
|
|
280
|
-
it "converts
|
280
|
+
it "converts to `it 'has 2 items' do subject.size.should == 2 end` form" do
|
281
281
|
rewritten_source.should == expected_source
|
282
282
|
end
|
283
283
|
|
@@ -288,7 +288,7 @@ module Transpec
|
|
288
288
|
end
|
289
289
|
end
|
290
290
|
|
291
|
-
context '
|
291
|
+
context 'with expression `it { should_not have(2).items }`' do
|
292
292
|
let(:source) do
|
293
293
|
<<-END
|
294
294
|
describe 'example' do
|
@@ -307,7 +307,7 @@ module Transpec
|
|
307
307
|
END
|
308
308
|
end
|
309
309
|
|
310
|
-
it "converts
|
310
|
+
it "converts to `it 'does not have 2 items' do subject.size.should_not == 2 end` form" do
|
311
311
|
rewritten_source.should == expected_source
|
312
312
|
end
|
313
313
|
|
@@ -318,7 +318,7 @@ module Transpec
|
|
318
318
|
end
|
319
319
|
end
|
320
320
|
|
321
|
-
context '
|
321
|
+
context 'with expression `it { should have(1).items }`' do
|
322
322
|
let(:source) do
|
323
323
|
<<-END
|
324
324
|
describe 'example' do
|
@@ -337,7 +337,7 @@ module Transpec
|
|
337
337
|
END
|
338
338
|
end
|
339
339
|
|
340
|
-
it "converts
|
340
|
+
it "converts to `it 'has 1 item' do subject.size.should == 1 end` form" do
|
341
341
|
rewritten_source.should == expected_source
|
342
342
|
end
|
343
343
|
|
@@ -348,7 +348,7 @@ module Transpec
|
|
348
348
|
end
|
349
349
|
end
|
350
350
|
|
351
|
-
context '
|
351
|
+
context 'with expression `it { should have(0).items }`' do
|
352
352
|
let(:source) do
|
353
353
|
<<-END
|
354
354
|
describe 'example' do
|
@@ -367,7 +367,7 @@ module Transpec
|
|
367
367
|
END
|
368
368
|
end
|
369
369
|
|
370
|
-
it "converts
|
370
|
+
it "converts to `it 'has no items' do subject.size.should == 0 end` form" do
|
371
371
|
rewritten_source.should == expected_source
|
372
372
|
end
|
373
373
|
|
@@ -378,7 +378,7 @@ module Transpec
|
|
378
378
|
end
|
379
379
|
end
|
380
380
|
|
381
|
-
context '
|
381
|
+
context 'with expression `it { should have(variable).items }`' do
|
382
382
|
let(:source) do
|
383
383
|
<<-END
|
384
384
|
describe 'example' do
|
@@ -397,7 +397,7 @@ module Transpec
|
|
397
397
|
END
|
398
398
|
end
|
399
399
|
|
400
|
-
it "converts
|
400
|
+
it "converts to `it 'has variable items' do subject.size.should == variable end` form" do
|
401
401
|
rewritten_source.should == expected_source
|
402
402
|
end
|
403
403
|
|
@@ -408,7 +408,7 @@ module Transpec
|
|
408
408
|
end
|
409
409
|
end
|
410
410
|
|
411
|
-
context '
|
411
|
+
context 'with expression `it { should_not have(0).items }`' do
|
412
412
|
let(:source) do
|
413
413
|
<<-END
|
414
414
|
describe 'example' do
|
@@ -427,7 +427,7 @@ module Transpec
|
|
427
427
|
END
|
428
428
|
end
|
429
429
|
|
430
|
-
it "converts
|
430
|
+
it "converts to `it 'does not have 0 items' do subject.size.should_not == 0 end` form" do
|
431
431
|
rewritten_source.should == expected_source
|
432
432
|
end
|
433
433
|
|
@@ -438,7 +438,7 @@ module Transpec
|
|
438
438
|
end
|
439
439
|
end
|
440
440
|
|
441
|
-
context '
|
441
|
+
context 'with expression multiline `it { should have(2).items }`' do
|
442
442
|
let(:source) do
|
443
443
|
<<-END
|
444
444
|
describe 'example' do
|
@@ -459,7 +459,7 @@ module Transpec
|
|
459
459
|
END
|
460
460
|
end
|
461
461
|
|
462
|
-
it "converts
|
462
|
+
it "converts to `it 'has 2 items' { subject.size.should == 2 }` form" do
|
463
463
|
rewritten_source.should == expected_source
|
464
464
|
end
|
465
465
|
|
@@ -470,7 +470,7 @@ module Transpec
|
|
470
470
|
end
|
471
471
|
end
|
472
472
|
|
473
|
-
context "
|
473
|
+
context "with expression `it 'has 2 items' do should have(2).items end`" do
|
474
474
|
let(:source) do
|
475
475
|
<<-END
|
476
476
|
describe 'example' do
|
@@ -491,7 +491,7 @@ module Transpec
|
|
491
491
|
END
|
492
492
|
end
|
493
493
|
|
494
|
-
it "converts
|
494
|
+
it "converts to `it 'has 2 items' do subject.size.should == 2 end` form" do
|
495
495
|
rewritten_source.should == expected_source
|
496
496
|
end
|
497
497
|
|
@@ -502,7 +502,7 @@ module Transpec
|
|
502
502
|
end
|
503
503
|
end
|
504
504
|
|
505
|
-
context '
|
505
|
+
context 'with expression `it { should have_at_least(2).items }`' do
|
506
506
|
let(:source) do
|
507
507
|
<<-END
|
508
508
|
describe 'example' do
|
@@ -521,7 +521,7 @@ module Transpec
|
|
521
521
|
END
|
522
522
|
end
|
523
523
|
|
524
|
-
it "converts
|
524
|
+
it "converts to `it 'has at least 2 items' do subject.size.should >= 2 end` form" do
|
525
525
|
rewritten_source.should == expected_source
|
526
526
|
end
|
527
527
|
|
@@ -532,7 +532,7 @@ module Transpec
|
|
532
532
|
end
|
533
533
|
end
|
534
534
|
|
535
|
-
context '
|
535
|
+
context 'with expression `it { should have(2).words }`' do
|
536
536
|
context 'with runtime information' do
|
537
537
|
include_context 'dynamic analysis objects'
|
538
538
|
|
@@ -567,7 +567,7 @@ module Transpec
|
|
567
567
|
END
|
568
568
|
end
|
569
569
|
|
570
|
-
it "converts
|
570
|
+
it "converts to `it 'has 2 words' do subject.words.size.should == 2 end` form" do
|
571
571
|
rewritten_source.should == expected_source
|
572
572
|
end
|
573
573
|
|
@@ -588,7 +588,7 @@ module Transpec
|
|
588
588
|
|
589
589
|
include_examples 'does not convert if project requires have(n).items matcher'
|
590
590
|
|
591
|
-
context '
|
591
|
+
context 'with expression `it { should have(2).items }`' do
|
592
592
|
let(:source) do
|
593
593
|
<<-END
|
594
594
|
describe 'example' do
|
@@ -607,7 +607,7 @@ module Transpec
|
|
607
607
|
END
|
608
608
|
end
|
609
609
|
|
610
|
-
it "converts
|
610
|
+
it "converts to `it 'has 2 items' do expect(subject.size).to eq(2) end` form" do
|
611
611
|
rewritten_source.should == expected_source
|
612
612
|
end
|
613
613
|
|
@@ -618,7 +618,7 @@ module Transpec
|
|
618
618
|
end
|
619
619
|
end
|
620
620
|
|
621
|
-
context '
|
621
|
+
context 'with expression `it { should_not have(2).items }`' do
|
622
622
|
let(:source) do
|
623
623
|
<<-END
|
624
624
|
describe 'example' do
|
@@ -637,7 +637,7 @@ module Transpec
|
|
637
637
|
END
|
638
638
|
end
|
639
639
|
|
640
|
-
it "converts
|
640
|
+
it "converts to `it 'does not have 2 items' do expect(subject.size).not_to eq(2) end` form" do
|
641
641
|
rewritten_source.should == expected_source
|
642
642
|
end
|
643
643
|
|