transpec 2.2.0 → 2.2.1
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 +4 -0
- data/README.md +3 -3
- data/README.md.erb +3 -3
- data/Rakefile +1 -1
- data/lib/transpec/commit_message.rb +1 -1
- data/lib/transpec/syntax/pending.rb +2 -0
- data/lib/transpec/version.rb +1 -1
- data/spec/transpec/commit_message_spec.rb +4 -2
- data/spec/transpec/syntax/pending_spec.rb +33 -0
- data/tasks/fixtures/mail/2.99.0/COMMIT_EDITMSG +2 -2
- data/tasks/fixtures/mail/3.0.0/COMMIT_EDITMSG +3 -3
- data/tasks/fixtures/twitter/2.99.0/COMMIT_EDITMSG +2 -2
- data/tasks/fixtures/twitter/3.0.0/COMMIT_EDITMSG +3 -3
- metadata +2 -4
- data/tasks/fixtures/guard/2.99.0/COMMIT_EDITMSG +0 -82
- data/tasks/fixtures/guard/3.0.0/COMMIT_EDITMSG +0 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6b25e36a9c0ed121a64efdb418255cc4c503112
|
4
|
+
data.tar.gz: ce7f2540fc51d7649fdad98c22e5e8994d7c74c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb1a7aea414278e08a8f850edda5fef805f6be73428daa30bd32c855766bd6a0c7168ea4e9266b796436a5d3f1dabf4370a3a7bf8640519164b1635a3eacf08c
|
7
|
+
data.tar.gz: 11b6fd391046cf62018406f835d9655061dcb9f28c0745e3f4b7041ec4a56630c12869eea41c3a3e409a4fdf884741a5aebef81741840fec65d216cc74b87667
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -12,7 +12,7 @@ With Transpec you can upgrade your RSpec 2 specs to RSpec 3 in no time.
|
|
12
12
|
It supports [conversions](#supported-conversions) for almost all of the RSpec 3 changes – not only the `expect` syntax.
|
13
13
|
Also, you can use it on your RSpec 2 project even if you're not going to upgrade it to RSpec 3 for now.
|
14
14
|
|
15
|
-
Check out the following
|
15
|
+
Check out the following posts for the new RSpec syntax and the changes in RSpec 3:
|
16
16
|
|
17
17
|
* [Myron Marston » RSpec's New Expectation Syntax](http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax)
|
18
18
|
* [RSpec's new message expectation syntax - Tea is awesome.](http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/)
|
@@ -1048,7 +1048,7 @@ end
|
|
1048
1048
|
|
1049
1049
|
Or with `--no-yield-any-instance` option they will be converted to:
|
1050
1050
|
|
1051
|
-
```
|
1051
|
+
```ruby
|
1052
1052
|
RSpec.configure do |rspec|
|
1053
1053
|
rspec.mock_with :rspec do |mocks|
|
1054
1054
|
# In RSpec 3, `any_instance` implementation blocks will be yielded the receiving
|
@@ -1277,7 +1277,7 @@ end
|
|
1277
1277
|
|
1278
1278
|
Or with `--no-explicit-spec-type` option they will be converted to:
|
1279
1279
|
|
1280
|
-
```
|
1280
|
+
```ruby
|
1281
1281
|
RSpec.configure do |rspec|
|
1282
1282
|
# rspec-rails 3 will no longer automatically infer an example group's spec type
|
1283
1283
|
# from the file location. You can explicitly opt-in to the feature using this
|
data/README.md.erb
CHANGED
@@ -12,7 +12,7 @@ With Transpec you can upgrade your RSpec 2 specs to RSpec 3 in no time.
|
|
12
12
|
It supports [conversions](#supported-conversions) for almost all of the RSpec 3 changes – not only the `expect` syntax.
|
13
13
|
Also, you can use it on your RSpec 2 project even if you're not going to upgrade it to RSpec 3 for now.
|
14
14
|
|
15
|
-
Check out the following
|
15
|
+
Check out the following posts for the new RSpec syntax and the changes in RSpec 3:
|
16
16
|
|
17
17
|
* [Myron Marston » RSpec's New Expectation Syntax](http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax)
|
18
18
|
* [RSpec's new message expectation syntax - Tea is awesome.](http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/)
|
@@ -1137,7 +1137,7 @@ Will be converted to:
|
|
1137
1137
|
|
1138
1138
|
Or with `--no-yield-any-instance` option they will be converted to:
|
1139
1139
|
|
1140
|
-
```
|
1140
|
+
```ruby
|
1141
1141
|
<%= convert(example, cli: ['--no-yield-any-instance'], rspec_version: rspec_version) -%>
|
1142
1142
|
```
|
1143
1143
|
|
@@ -1332,7 +1332,7 @@ Will be converted to:
|
|
1332
1332
|
|
1333
1333
|
Or with `--no-explicit-spec-type` option they will be converted to:
|
1334
1334
|
|
1335
|
-
```
|
1335
|
+
```ruby
|
1336
1336
|
<%= convert(example, rspec_version: rspec_version, path: 'spec/models/some_model_spec.rb', cli: ['--no-explicit-spec-type']) -%>
|
1337
1337
|
```
|
1338
1338
|
|
data/Rakefile
CHANGED
data/lib/transpec/version.rb
CHANGED
@@ -20,8 +20,9 @@ module Transpec
|
|
20
20
|
end
|
21
21
|
|
22
22
|
describe '#to_s' do
|
23
|
-
it 'wraps lines within 72 characters' do
|
23
|
+
it 'wraps lines within 72 characters except URLs' do
|
24
24
|
commit_message.to_s.each_line do |line|
|
25
|
+
next if line.match(%r{\bhttps?://})
|
25
26
|
line.chomp.size.should <= 72
|
26
27
|
end
|
27
28
|
end
|
@@ -71,7 +72,8 @@ module Transpec
|
|
71
72
|
end
|
72
73
|
|
73
74
|
it 'has the URL at the last line' do
|
74
|
-
body_lines[-1].chomp.should ==
|
75
|
+
body_lines[-1].chomp.should ==
|
76
|
+
'For more details: https://github.com/yujinakayama/transpec#supported-conversions'
|
75
77
|
end
|
76
78
|
end
|
77
79
|
end
|
@@ -224,6 +224,39 @@ module Transpec
|
|
224
224
|
it 'converts to `pending; do_something_fail` form' do
|
225
225
|
rewritten_source.should == expected_source
|
226
226
|
end
|
227
|
+
|
228
|
+
context 'and the block body includes an empty line' do
|
229
|
+
let(:source) do
|
230
|
+
<<-END
|
231
|
+
describe 'example' do
|
232
|
+
it 'is expected to fail' do
|
233
|
+
pending do
|
234
|
+
do_something_first
|
235
|
+
|
236
|
+
do_something_fail
|
237
|
+
end
|
238
|
+
end
|
239
|
+
end
|
240
|
+
END
|
241
|
+
end
|
242
|
+
|
243
|
+
let(:expected_source) do
|
244
|
+
<<-END
|
245
|
+
describe 'example' do
|
246
|
+
it 'is expected to fail' do
|
247
|
+
pending
|
248
|
+
do_something_first
|
249
|
+
|
250
|
+
do_something_fail
|
251
|
+
end
|
252
|
+
end
|
253
|
+
END
|
254
|
+
end
|
255
|
+
|
256
|
+
it 'properly converts' do
|
257
|
+
rewritten_source.should == expected_source
|
258
|
+
end
|
259
|
+
end
|
227
260
|
end
|
228
261
|
|
229
262
|
context "with expression multiline `pending('some reason') { do_something_fail }`" do
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Convert specs to RSpec 2.99.0.beta2 syntax with Transpec
|
2
2
|
|
3
|
-
This conversion is done by Transpec
|
3
|
+
This conversion is done by Transpec 2.2.0 with the following command:
|
4
4
|
transpec --force
|
5
5
|
|
6
6
|
* 2161 conversions
|
@@ -83,4 +83,4 @@ This conversion is done by Transpec 1.13.1 with the following command:
|
|
83
83
|
from: obj.stub!(:message)
|
84
84
|
to: obj.stub(:message)
|
85
85
|
|
86
|
-
|
86
|
+
For more details: https://github.com/yujinakayama/transpec#supported-conversions
|
@@ -1,6 +1,6 @@
|
|
1
|
-
Convert specs to RSpec 3.0.0
|
1
|
+
Convert specs to RSpec 3.0.0 syntax with Transpec
|
2
2
|
|
3
|
-
This conversion is done by Transpec
|
3
|
+
This conversion is done by Transpec 2.2.0 with the following command:
|
4
4
|
transpec --force --convert example_group,hook_scope
|
5
5
|
|
6
6
|
* 82 conversions
|
@@ -27,4 +27,4 @@ This conversion is done by Transpec 1.13.1 with the following command:
|
|
27
27
|
from: obj.stub(:message => value)
|
28
28
|
to: allow(obj).to receive_messages(:message => value)
|
29
29
|
|
30
|
-
|
30
|
+
For more details: https://github.com/yujinakayama/transpec#supported-conversions
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Convert specs to RSpec 2.99.0.beta2 syntax with Transpec
|
2
2
|
|
3
|
-
This conversion is done by Transpec
|
3
|
+
This conversion is done by Transpec 2.2.0 with the following command:
|
4
4
|
transpec --force
|
5
5
|
|
6
6
|
* 899 conversions
|
@@ -35,4 +35,4 @@ This conversion is done by Transpec 1.13.1 with the following command:
|
|
35
35
|
from: obj.stub!(:message)
|
36
36
|
to: allow(obj).to receive(:message)
|
37
37
|
|
38
|
-
|
38
|
+
For more details: https://github.com/yujinakayama/transpec#supported-conversions
|
@@ -1,6 +1,6 @@
|
|
1
|
-
Convert specs to RSpec 3.0.0
|
1
|
+
Convert specs to RSpec 3.0.0 syntax with Transpec
|
2
2
|
|
3
|
-
This conversion is done by Transpec
|
3
|
+
This conversion is done by Transpec 2.2.0 with the following command:
|
4
4
|
transpec --force --convert example_group,hook_scope
|
5
5
|
|
6
6
|
* 54 conversions
|
@@ -15,4 +15,4 @@ This conversion is done by Transpec 1.13.1 with the following command:
|
|
15
15
|
from: before(:all) { }
|
16
16
|
to: before(:context) { }
|
17
17
|
|
18
|
-
|
18
|
+
For more details: https://github.com/yujinakayama/transpec#supported-conversions
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: transpec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuji Nakayama
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parser
|
@@ -372,8 +372,6 @@ files:
|
|
372
372
|
- spec/transpec_spec.rb
|
373
373
|
- tasks/ci/spec.rake
|
374
374
|
- tasks/demo.rake
|
375
|
-
- tasks/fixtures/guard/2.99.0/COMMIT_EDITMSG
|
376
|
-
- tasks/fixtures/guard/3.0.0/COMMIT_EDITMSG
|
377
375
|
- tasks/fixtures/mail/2.99.0/COMMIT_EDITMSG
|
378
376
|
- tasks/fixtures/mail/3.0.0/COMMIT_EDITMSG
|
379
377
|
- tasks/fixtures/twitter/2.99.0/COMMIT_EDITMSG
|
@@ -1,82 +0,0 @@
|
|
1
|
-
Convert specs to RSpec 2.99.0.beta2 syntax with Transpec
|
2
|
-
|
3
|
-
This conversion is done by Transpec 1.13.1 with the following command:
|
4
|
-
transpec --force
|
5
|
-
|
6
|
-
* 396 conversions
|
7
|
-
from: obj.should_receive(:message)
|
8
|
-
to: expect(obj).to receive(:message)
|
9
|
-
|
10
|
-
* 239 conversions
|
11
|
-
from: obj.should
|
12
|
-
to: expect(obj).to
|
13
|
-
|
14
|
-
* 113 conversions
|
15
|
-
from: obj.stub(:message)
|
16
|
-
to: allow(obj).to receive(:message)
|
17
|
-
|
18
|
-
* 94 conversions
|
19
|
-
from: obj.should_not_receive(:message)
|
20
|
-
to: expect(obj).not_to receive(:message)
|
21
|
-
|
22
|
-
* 86 conversions
|
23
|
-
from: == expected
|
24
|
-
to: eq(expected)
|
25
|
-
|
26
|
-
* 16 conversions
|
27
|
-
from: stub('something')
|
28
|
-
to: double('something')
|
29
|
-
|
30
|
-
* 15 conversions
|
31
|
-
from: be_true
|
32
|
-
to: be_truthy
|
33
|
-
|
34
|
-
* 15 conversions
|
35
|
-
from: obj.stub!(:message)
|
36
|
-
to: allow(obj).to receive(:message)
|
37
|
-
|
38
|
-
* 13 conversions
|
39
|
-
from: mock('something')
|
40
|
-
to: double('something')
|
41
|
-
|
42
|
-
* 10 conversions
|
43
|
-
from: lambda { }.should_not
|
44
|
-
to: expect { }.not_to
|
45
|
-
|
46
|
-
* 10 conversions
|
47
|
-
from: obj.should_not
|
48
|
-
to: expect(obj).not_to
|
49
|
-
|
50
|
-
* 7 conversions
|
51
|
-
from: be_false
|
52
|
-
to: be_falsey
|
53
|
-
|
54
|
-
* 7 conversions
|
55
|
-
from: obj.unstub(:message)
|
56
|
-
to: allow(obj).to receive(:message).and_call_original
|
57
|
-
|
58
|
-
* 5 conversions
|
59
|
-
from: pending
|
60
|
-
to: skip
|
61
|
-
|
62
|
-
* 4 conversions
|
63
|
-
from: lambda { }.should
|
64
|
-
to: expect { }.to
|
65
|
-
|
66
|
-
* 4 conversions
|
67
|
-
from: obj.should_receive(:message).any_number_of_times
|
68
|
-
to: allow(obj).to receive(:message)
|
69
|
-
|
70
|
-
* 3 conversions
|
71
|
-
from: collection.should have(n).items
|
72
|
-
to: expect(collection.size).to eq(n)
|
73
|
-
|
74
|
-
* 1 conversion
|
75
|
-
from: it { should ... }
|
76
|
-
to: it { is_expected.to ... }
|
77
|
-
|
78
|
-
* 1 conversion
|
79
|
-
from: it { should_not ... }
|
80
|
-
to: it { is_expected.not_to ... }
|
81
|
-
|
82
|
-
See also: https://github.com/yujinakayama/transpec#supported-conversions
|
@@ -1,34 +0,0 @@
|
|
1
|
-
Convert specs to RSpec 3.0.0.beta2 syntax with Transpec
|
2
|
-
|
3
|
-
This conversion is done by Transpec 1.13.1 with the following command:
|
4
|
-
transpec --force --convert example_group,hook_scope
|
5
|
-
|
6
|
-
* 31 conversions
|
7
|
-
from: describe 'something' { }
|
8
|
-
to: RSpec.describe 'something' { }
|
9
|
-
|
10
|
-
* 16 conversions
|
11
|
-
from: obj.stub(:message => value)
|
12
|
-
to: allow(obj).to receive_messages(:message => value)
|
13
|
-
|
14
|
-
* 13 conversions
|
15
|
-
from: before(:all) { }
|
16
|
-
to: before(:context) { }
|
17
|
-
|
18
|
-
* 10 conversions
|
19
|
-
from: before(:each) { }
|
20
|
-
to: before(:example) { }
|
21
|
-
|
22
|
-
* 8 conversions
|
23
|
-
from: after(:all) { }
|
24
|
-
to: after(:context) { }
|
25
|
-
|
26
|
-
* 4 conversions
|
27
|
-
from: shared_examples_for 'something' { }
|
28
|
-
to: RSpec.shared_examples_for 'something' { }
|
29
|
-
|
30
|
-
* 1 conversion
|
31
|
-
from: after(:each) { }
|
32
|
-
to: after(:example) { }
|
33
|
-
|
34
|
-
See also: https://github.com/yujinakayama/transpec#supported-conversions
|