transpec 1.12.0 → 1.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +103 -99
- data/README.md +52 -8
- data/README.md.erb +240 -95
- data/Rakefile +3 -1
- data/lib/transpec/base_rewriter.rb +1 -1
- data/lib/transpec/cli.rb +2 -1
- data/lib/transpec/converter.rb +9 -65
- data/lib/transpec/spec_suite.rb +3 -36
- data/lib/transpec/syntax.rb +61 -4
- data/lib/transpec/util.rb +0 -6
- data/lib/transpec/version.rb +1 -1
- data/spec/transpec/cli_spec.rb +6 -11
- data/spec/transpec/converter_spec.rb +0 -173
- data/spec/transpec/dynamic_analyzer_spec.rb +1 -1
- data/spec/transpec/record_spec.rb +15 -0
- data/spec/transpec_spec.rb +8 -0
- data/tasks/lib/test.rb +1 -0
- data/tasks/readme.rake +115 -46
- data/tasks/test.rake +2 -6
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1380a29e5d1d69345538ed009fee77b52c9c1476
|
4
|
+
data.tar.gz: 76891cd865379b4e43d55e890bf076e6be404777
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b6f75a2ea40fa95e6cb8d7eba12ac63e6ea3d7c03bc3b8b2e0cd85b39d5a4a0215a3139aad09e980c89eaaccc8d5880392d8f4793ef5e314d37d25a755ec5f9
|
7
|
+
data.tar.gz: df0ecc276f65e263cf1c0fe53275ef84d8d884e159a4ade6d92f83a3348b8d2f35829fc98b29ae6d87609a0c0d8b5d8cba66e5331e3c22aed94689473db255df
|
data/CHANGELOG.md
CHANGED
@@ -2,251 +2,255 @@
|
|
2
2
|
|
3
3
|
## Development
|
4
4
|
|
5
|
+
## v1.13.0
|
6
|
+
|
7
|
+
* Improve the conversion performance.
|
8
|
+
|
5
9
|
## v1.12.0
|
6
10
|
|
7
|
-
* Support conversion of hook scope names ([#53](https://github.com/yujinakayama/transpec/issues/53))
|
11
|
+
* Support conversion of hook scope names. ([#53](https://github.com/yujinakayama/transpec/issues/53))
|
8
12
|
|
9
13
|
## v1.11.1
|
10
14
|
|
11
|
-
* Add missing description of `example_group` for `-v/--convert` option in the `-h/--help` text
|
15
|
+
* Add missing description of `example_group` for `-v/--convert` option in the `-h/--help` text.
|
12
16
|
|
13
17
|
## v1.11.0
|
14
18
|
|
15
|
-
* Support conversion to non-monkey-patch example groups ([#22](https://github.com/yujinakayama/transpec/issues/22))
|
16
|
-
* Support conversion of `unstub
|
17
|
-
* Modify `yield_receiver_to_any_instance_implementation_blocks` configuration in `RSpec.configure` only when necessary ([#56](https://github.com/yujinakayama/transpec/issues/56))
|
18
|
-
* Modify only the main `RSpec.configure` when there are multiple ones ([#56](https://github.com/yujinakayama/transpec/issues/56))
|
19
|
-
* Add `-v/--convert` option that allows to enable conversions that are disabled by default
|
20
|
-
* Deprecate `-t/--convert-stub-with-hash` option
|
19
|
+
* Support conversion to non-monkey-patch example groups. ([#22](https://github.com/yujinakayama/transpec/issues/22))
|
20
|
+
* Support conversion of `unstub`. ([#49](https://github.com/yujinakayama/transpec/issues/49))
|
21
|
+
* Modify `yield_receiver_to_any_instance_implementation_blocks` configuration in `RSpec.configure` only when necessary. ([#56](https://github.com/yujinakayama/transpec/issues/56))
|
22
|
+
* Modify only the main `RSpec.configure` when there are multiple ones. ([#56](https://github.com/yujinakayama/transpec/issues/56))
|
23
|
+
* Add `-v/--convert` option that allows to enable conversions that are disabled by default.
|
24
|
+
* Deprecate `-t/--convert-stub-with-hash` option.
|
21
25
|
|
22
26
|
## v1.10.4
|
23
27
|
|
24
|
-
* Avoid confusing methods defined with `#let` or `#subject` by user with RSpec built-in methods ([#55](https://github.com/yujinakayama/transpec/issues/55))
|
25
|
-
* Add experimental support for Ruby 2.2 (development version) by falling back to Ruby 2.1 parser
|
28
|
+
* Avoid confusing methods defined with `#let` or `#subject` by user with RSpec built-in methods. ([#55](https://github.com/yujinakayama/transpec/issues/55))
|
29
|
+
* Add experimental support for Ruby 2.2 (development version) by falling back to Ruby 2.1 parser.
|
26
30
|
|
27
31
|
## v1.10.3
|
28
32
|
|
29
|
-
* Suggest using `-c/--rspec-command` option and exit gracefully when dynamic analysis failed ([#52](https://github.com/yujinakayama/transpec/issues/52))
|
33
|
+
* Suggest using `-c/--rspec-command` option and exit gracefully when dynamic analysis failed. ([#52](https://github.com/yujinakayama/transpec/issues/52))
|
30
34
|
|
31
35
|
## v1.10.2
|
32
36
|
|
33
|
-
* Fix a bug where `expect(an_array + another_array).to have(2).items` was converted to `expect(an_array +(another_array).size).to eq(2)
|
37
|
+
* Fix a bug where `expect(an_array + another_array).to have(2).items` was converted to `expect(an_array +(another_array).size).to eq(2)`.
|
34
38
|
|
35
39
|
## v1.10.1
|
36
40
|
|
37
|
-
* Fix a bug where `expect(hash['some_key']).to have(2).items` was converted to `expect(hash[().size).to eq(2)` ([#51](https://github.com/yujinakayama/transpec/issues/51))
|
41
|
+
* Fix a bug where `expect.(hash['some_key']).to have(2).items` was converted to `expect(hash[().size).to eq(2)` ([#51](https://github.com/yujinakayama/transpec/issues/51))
|
38
42
|
|
39
43
|
## v1.10.0
|
40
44
|
|
41
|
-
* Support conversion of pending examples
|
42
|
-
* Display cautions for less-accurate conversions caused by a lack of runtime information ([#42](https://github.com/yujinakayama/transpec/issues/42))
|
45
|
+
* Support conversion of pending examples.
|
46
|
+
* Display cautions for less-accurate conversions caused by a lack of runtime information. ([#42](https://github.com/yujinakayama/transpec/issues/42))
|
43
47
|
|
44
48
|
## v1.9.3
|
45
49
|
|
46
|
-
* Handle `variable.any_instance
|
47
|
-
* Fix a bug where the DSL `example
|
50
|
+
* Handle `variable.any_instance`. ([#46](https://github.com/yujinakayama/transpec/issues/46))
|
51
|
+
* Fix a bug where the DSL `example`. (an alias of `it`) was confused with current example object (e.g. `example 'it does something' do ... end` was converted to `example 'it does something' do |example| ... end`)
|
48
52
|
|
49
53
|
## v1.9.2
|
50
54
|
|
51
|
-
* Fix a bug where `expect(method_returns_collection :some_arg).to have(2).items` was converted to `expect(method_returns_collection :some_arg.size).to eq(2)` ([#43](https://github.com/yujinakayama/transpec/issues/43))
|
52
|
-
* Fix false positive conversion of `raise_error` with `with_message
|
55
|
+
* Fix a bug where `expect.(method_returns_collection :some_arg).to have(2).items` was converted to `expect(method_returns_collection :some_arg.size).to eq(2)` ([#43](https://github.com/yujinakayama/transpec/issues/43))
|
56
|
+
* Fix false positive conversion of `raise_error` with `with_message`. ([#41](https://github.com/yujinakayama/transpec/issues/41))
|
53
57
|
|
54
58
|
## v1.9.1
|
55
59
|
|
56
|
-
* Fix crash on `expect(obj).to non_matcher_object` in dynamic analysis ([#39](https://github.com/yujinakayama/transpec/issues/39))
|
60
|
+
* Fix crash on `expect.(obj).to non_matcher_object` in dynamic analysis ([#39](https://github.com/yujinakayama/transpec/issues/39))
|
57
61
|
|
58
62
|
## v1.9.0
|
59
63
|
|
60
|
-
* Support conversion of `and_return { value }` and `and_return` without arguments
|
61
|
-
* Fix a bug where conversion of `.any_number_of_times` and `at_least(0)` with `obj.stub(:message)` weren't reported in the final summary
|
62
|
-
* Fix a bug where arguments of `any_instance` implementation blocks weren't converted when a `receive` matcher was chained by the fluent interface (e.g. `expect_any_instance_of(Klass).to receive(:message).once { |arg| }`)
|
64
|
+
* Support conversion of `and_return { value }` and `and_return` without arguments.
|
65
|
+
* Fix a bug where conversion of `.any_number_of_times` and `at_least(0)` with `obj.stub(:message)` weren't reported in the final summary.
|
66
|
+
* Fix a bug where arguments of `any_instance` implementation blocks weren't converted when a `receive` matcher was chained by the fluent interface. (e.g. `expect_any_instance_of(Klass).to receive(:message).once { |arg| }`)
|
63
67
|
|
64
68
|
## v1.8.0
|
65
69
|
|
66
|
-
* Conversion of `obj.stub(:message => value)` to `allow(obj).to receive(:message).and_return(value)` is now opt-in with `-t/--convert-stub-with-hash` option when `receive_messages` is unavailable
|
70
|
+
* Conversion of `obj.stub(:message => value)` to `allow(obj).to receive(:message).and_return(value)` is now opt-in with `-t/--convert-stub-with-hash` option when `receive_messages` is unavailable.
|
67
71
|
|
68
72
|
## v1.7.0
|
69
73
|
|
70
|
-
* Support conversion of `any_instance` block
|
74
|
+
* Support conversion of `any_instance` block.
|
71
75
|
|
72
76
|
## v1.6.1
|
73
77
|
|
74
|
-
* Handle deprecation messages from `rainbow` gem
|
78
|
+
* Handle deprecation messages from `rainbow` gem.
|
75
79
|
|
76
80
|
## v1.6.0
|
77
81
|
|
78
|
-
* Native support for Ruby 2.1 syntax with Parser 2.1
|
79
|
-
* Support conversion of the custom matcher DSL ([#30](https://github.com/yujinakayama/transpec/issues/30))
|
80
|
-
* Support Capybara DSL in static context analysis (the logic used with `-s/--skip-dynamic-analysis`)
|
82
|
+
* Native support for Ruby 2.1 syntax with Parser 2.1.
|
83
|
+
* Support conversion of the custom matcher DSL. ([#30](https://github.com/yujinakayama/transpec/issues/30))
|
84
|
+
* Support Capybara DSL in static context analysis. (the logic used with `-s/--skip-dynamic-analysis`)
|
81
85
|
|
82
86
|
## v1.5.1
|
83
87
|
|
84
|
-
* Check whether a `stub` is RSpec's one or not with a static whitelist when there's no runtime data ([#33](https://github.com/yujinakayama/transpec/issues/33))
|
85
|
-
* Fix a bug where one-liner `should` was converted to `is_expected.to` on RSpec 3.0.0.beta1 (available since 2.99.0.beta2 and 3.0.0.beta2)
|
88
|
+
* Check whether a `stub` is RSpec's one or not with a static whitelist when there's no runtime data. ([#33](https://github.com/yujinakayama/transpec/issues/33))
|
89
|
+
* Fix a bug where one-liner `should` was converted to `is_expected.to` on RSpec 3.0.0.beta1. (available since 2.99.0.beta2 and 3.0.0.beta2)
|
86
90
|
|
87
91
|
## v1.5.0
|
88
92
|
|
89
|
-
* Mention the project's RSpec version in the auto-generated commit message
|
90
|
-
* Deprecate `-m/--generate-commit-message` option (A commit message will always be generated)
|
91
|
-
* Display actual `Proc` constructor names in the summary of expectations on block
|
93
|
+
* Mention the project's RSpec version in the auto-generated commit message.
|
94
|
+
* Deprecate `-m/--generate-commit-message` option. (A commit message will always be generated)
|
95
|
+
* Display actual `Proc` constructor names in the summary of expectations on block.
|
92
96
|
|
93
97
|
## v1.4.1
|
94
98
|
|
95
|
-
* Support Ruby 2.1 runtime by falling back to Ruby 2.0 parser
|
99
|
+
* Support Ruby 2.1 runtime by falling back to Ruby 2.0 parser.
|
96
100
|
|
97
101
|
## v1.4.0
|
98
102
|
|
99
|
-
* Support conversion of `RSpec::Core::ExampleGroup#example
|
100
|
-
* Support conversion of one-liner syntax ([#25](https://github.com/yujinakayama/transpec/issues/25))
|
101
|
-
* Support conversion of one-liner syntax with `have(n).items` matcher
|
102
|
-
* Support conversion of `stub_chain
|
103
|
-
* Fix a bug where `-p/--no-parentheses-matcher-arg` was not applied to the conversion of `have(n).items` with `expect
|
104
|
-
* Fix a bug where conversion summaries of `have(n).item` with negative expectation were reported as positive expectations
|
103
|
+
* Support conversion of `RSpec::Core::ExampleGroup#example`. ([#23](https://github.com/yujinakayama/transpec/issues/23))
|
104
|
+
* Support conversion of one-liner syntax. ([#25](https://github.com/yujinakayama/transpec/issues/25))
|
105
|
+
* Support conversion of one-liner syntax with `have(n).items` matcher.
|
106
|
+
* Support conversion of `stub_chain`.
|
107
|
+
* Fix a bug where `-p/--no-parentheses-matcher-arg` was not applied to the conversion of `have(n).items` with `expect`.
|
108
|
+
* Fix a bug where conversion summaries of `have(n).item` with negative expectation were reported as positive expectations.
|
105
109
|
|
106
110
|
## v1.3.1
|
107
111
|
|
108
|
-
* Proceed to conversion even if `rspec` didn't pass in dynamic analysis
|
112
|
+
* Proceed to conversion even if `rspec` didn't pass in dynamic analysis.
|
109
113
|
|
110
114
|
## v1.3.0
|
111
115
|
|
112
|
-
* Handle singular collection names like `have(n).item` ([#18](https://github.com/yujinakayama/transpec/issues/18))
|
113
|
-
* Handle collection accessors with arguments like `have(n).errors_on(...)` ([#18](https://github.com/yujinakayama/transpec/issues/18))
|
114
|
-
* Handle `described_class.any_instance
|
115
|
-
* Handle indirect `any_instance` subject with runtime information (e.g. `variable = SomeClass.any_instance; variable.stub(:message)`)
|
116
|
-
* Disable conversion of `have(n).items` automatically if `rspec-rails` or `rspec-collection_matchers` is loaded in the target project
|
117
|
-
* Disable conversion of `its` automatically if `rspec-its` is loaded in the target project
|
116
|
+
* Handle singular collection names like `have.(n).item` ([#18](https://github.com/yujinakayama/transpec/issues/18))
|
117
|
+
* Handle collection accessors with arguments like `have.(n).errors_on(...)` ([#18](https://github.com/yujinakayama/transpec/issues/18))
|
118
|
+
* Handle `described_class.any_instance`. ([#18](https://github.com/yujinakayama/transpec/issues/18))
|
119
|
+
* Handle indirect `any_instance` subject with runtime information. (e.g. `variable = SomeClass.any_instance; variable.stub(:message)`)
|
120
|
+
* Disable conversion of `have(n).items` automatically if `rspec-rails` or `rspec-collection_matchers` is loaded in the target project.
|
121
|
+
* Disable conversion of `its` automatically if `rspec-its` is loaded in the target project.
|
118
122
|
|
119
123
|
## v1.2.2
|
120
124
|
|
121
|
-
* Fix error `singleton can't be dumped (TypeError)` at the end of dynamic analysis ([#17](https://github.com/yujinakayama/transpec/issues/17))
|
122
|
-
* Do not copy pseudo files (device, socket, etc.) in dynamic analysis ([#17](https://github.com/yujinakayama/transpec/issues/17))
|
123
|
-
* Fix error `undefined method receive_messages_available?` while conversion ([#17](https://github.com/yujinakayama/transpec/issues/17))
|
125
|
+
* Fix error `singleton can't be dumped. (TypeError)` at the end of dynamic analysis ([#17](https://github.com/yujinakayama/transpec/issues/17))
|
126
|
+
* Do not copy pseudo files. (device, socket, etc.) in dynamic analysis ([#17](https://github.com/yujinakayama/transpec/issues/17))
|
127
|
+
* Fix error `undefined method receive_messages_available?` while conversion. ([#17](https://github.com/yujinakayama/transpec/issues/17))
|
124
128
|
|
125
129
|
## v1.2.1
|
126
130
|
|
127
|
-
* Apply `-p/--no-parentheses-matcher-arg` to the conversion of `have(n).items` (`obj.should have(n).items` is now converted to `expect(obj.size).to eq n` with `-p/--no-parentheses-matcher-arg`)
|
131
|
+
* Apply `-p/--no-parentheses-matcher-arg` to the conversion of `have.(n).items` (`obj.should have(n).items` is now converted to `expect(obj.size).to eq n` with `-p/--no-parentheses-matcher-arg`)
|
128
132
|
|
129
133
|
## v1.2.0
|
130
134
|
|
131
|
-
* Transpec is now ready for RSpec 2.99 and 3.0 beta
|
132
|
-
* Support conversion to `allow(obj).to receive_messages(:message => value)` ([#6](https://github.com/yujinakayama/transpec/issues/6))
|
133
|
-
* Support conversion to `be_truthy` / `be_falsey
|
134
|
-
* Add `-b/--boolean-matcher` option that allows to specify matcher type that `be_true` and `be_false` will be converted to
|
135
|
-
* Abort if a target project's `rspec` gem dependency is older than the version required by Transpec
|
135
|
+
* Transpec is now ready for RSpec 2.99 and 3.0 beta!.
|
136
|
+
* Support conversion to `allow.(obj).to receive_messages(:message => value)` ([#6](https://github.com/yujinakayama/transpec/issues/6))
|
137
|
+
* Support conversion to `be_truthy` / `be_falsey`. ([#8](https://github.com/yujinakayama/transpec/issues/8))
|
138
|
+
* Add `-b/--boolean-matcher` option that allows to specify matcher type that `be_true` and `be_false` will be converted to.
|
139
|
+
* Abort if a target project's `rspec` gem dependency is older than the version required by Transpec.
|
136
140
|
|
137
141
|
## v1.1.2
|
138
142
|
|
139
|
-
* Allow use of non monkey patch syntaxes in non example group contexts by including `RSpec::Matchers
|
143
|
+
* Allow use of non monkey patch syntaxes in non example group contexts by including `RSpec::Matchers`. ([#15](https://github.com/yujinakayama/transpec/issues/15))
|
140
144
|
|
141
145
|
## v1.1.1
|
142
146
|
|
143
|
-
* Fix failure of dynamic analysis when cwd was changed at exit of rspec
|
147
|
+
* Fix failure of dynamic analysis when cwd was changed at exit of rspec.
|
144
148
|
|
145
149
|
## v1.1.0
|
146
150
|
|
147
|
-
* Support conversion of `its
|
151
|
+
* Support conversion of `its`. ([#9](https://github.com/yujinakayama/transpec/issues/9))
|
148
152
|
|
149
153
|
## v1.0.0
|
150
154
|
|
151
|
-
* Now Transpec does dynamic code analysis
|
152
|
-
* Support conversion of `have(n).items` matcher ([#5](https://github.com/yujinakayama/transpec/issues/5))
|
153
|
-
* Add `-s/--skip-dynamic-analysis` option that allows to skip dynamic analysis and convert with only static analysis
|
154
|
-
* Add `-c/--rspec-command` option that allows to specify command to run RSpec that is used for dynamic analysis
|
155
|
-
* Check contexts correctly with runtime information
|
156
|
-
* Detect same name but non-RSpec methods with runtime information ([#4](https://github.com/yujinakayama/transpec/issues/4))
|
157
|
-
* Consider runtime type information when converting `=~` to `match_array
|
158
|
-
* Rename `-d/--disable` option to `-k/--keep` and change its syntax types
|
159
|
-
* Rename `--commit-message` option to `--generate-commit-message
|
155
|
+
* Now Transpec does dynamic code analysis!.
|
156
|
+
* Support conversion of `have.(n).items` matcher ([#5](https://github.com/yujinakayama/transpec/issues/5))
|
157
|
+
* Add `-s/--skip-dynamic-analysis` option that allows to skip dynamic analysis and convert with only static analysis.
|
158
|
+
* Add `-c/--rspec-command` option that allows to specify command to run RSpec that is used for dynamic analysis.
|
159
|
+
* Check contexts correctly with runtime information.
|
160
|
+
* Detect same name but non-RSpec methods with runtime information. ([#4](https://github.com/yujinakayama/transpec/issues/4))
|
161
|
+
* Consider runtime type information when converting `=~` to `match_array`.
|
162
|
+
* Rename `-d/--disable` option to `-k/--keep` and change its syntax types.
|
163
|
+
* Rename `--commit-message` option to `--generate-commit-message`.
|
160
164
|
|
161
165
|
## v0.2.6
|
162
166
|
|
163
|
-
* Fix a bug where `Node#each_descendent_node` enumerates only within depth 2
|
167
|
+
* Fix a bug where `Node#each_descendent_node` enumerates only within depth 2.
|
164
168
|
|
165
169
|
## v0.2.5
|
166
170
|
|
167
|
-
* Do not touch file if the source does not need to be rewritten
|
171
|
+
* Do not touch file if the source does not need to be rewritten.
|
168
172
|
|
169
173
|
## v0.2.4
|
170
174
|
|
171
|
-
* Improve context detection
|
175
|
+
* Improve context detection.
|
172
176
|
|
173
177
|
## v0.2.3
|
174
178
|
|
175
|
-
* Fix a bug where arguments of positive error expectation with block were removed (e.g. `expect { }.to raise_error(SpecificErrorClass) { |e| ... }` was converted to `expect { }.to raise_error { |e| ... }` unintentionally)
|
179
|
+
* Fix a bug where arguments of positive error expectation with block were removed. (e.g. `expect { }.to raise_error(SpecificErrorClass) { |e| ... }` was converted to `expect { }.to raise_error { |e| ... }` unintentionally)
|
176
180
|
|
177
181
|
## v0.2.2
|
178
182
|
|
179
|
-
* Fix a crash on syntax configuration with variable in `RSpec.configure
|
183
|
+
* Fix a crash on syntax configuration with variable in `RSpec.configure`. (e.g. `RSpec.configure { |config| config.expect_with { |c| c.syntax = some_syntax } }`)
|
180
184
|
|
181
185
|
## v0.2.1
|
182
186
|
|
183
|
-
* Fix a crash on operator matcher that have `__FILE__` in its arguments
|
187
|
+
* Fix a crash on operator matcher that have `__FILE__` in its arguments.
|
184
188
|
|
185
189
|
## v0.2.0
|
186
190
|
|
187
|
-
* Display conversion summary at the end
|
188
|
-
* Add `-m/--commit-message` option that allows to generate commit message automatically
|
191
|
+
* Display conversion summary at the end.
|
192
|
+
* Add `-m/--commit-message` option that allows to generate commit message automatically.
|
189
193
|
|
190
194
|
## v0.1.3
|
191
195
|
|
192
|
-
* Avoid confusing `Excon.stub` with RSpec's `stub
|
193
|
-
* Fix a bug where `be == 1` was converted into `be eq(1)` (now it's converted into `eq(1)`)
|
194
|
-
* Fix a bug where `obj.should==1` was converted into `obj.toeq1
|
196
|
+
* Avoid confusing `Excon.stub` with RSpec's `stub`. ([#4](https://github.com/yujinakayama/transpec/issues/4))
|
197
|
+
* Fix a bug where `be == 1` was converted into `be eq.(1)` (now it's converted into `eq(1)`)
|
198
|
+
* Fix a bug where `obj.should==1` was converted into `obj.toeq1`. (now it's converted into `obj.to eq(1)`)
|
195
199
|
|
196
200
|
## v0.1.2
|
197
201
|
|
198
|
-
* Continue processing files even if a file has invalid syntax
|
199
|
-
* Fix a crash on source `variable::Const
|
200
|
-
* Fix generating invalid code with here document followed by method
|
201
|
-
* Fix generating invalid code when converting `obj.should() == 1
|
202
|
+
* Continue processing files even if a file has invalid syntax.
|
203
|
+
* Fix a crash on source `variable::Const`.
|
204
|
+
* Fix generating invalid code with here document followed by method.
|
205
|
+
* Fix generating invalid code when converting `obj.should() == 1`.
|
202
206
|
|
203
207
|
## v0.1.1
|
204
208
|
|
205
|
-
* Fix a bug where `be > 1` was converted into `be be > 1
|
209
|
+
* Fix a bug where `be > 1` was converted into `be be > 1`.
|
206
210
|
|
207
211
|
## v0.1.0
|
208
212
|
|
209
|
-
* Highlight source in console when warning conversion error
|
210
|
-
* Add `--no-color` option
|
213
|
+
* Highlight source in console when warning conversion error.
|
214
|
+
* Add `--no-color` option.
|
211
215
|
|
212
216
|
## v0.0.10
|
213
217
|
|
214
|
-
* Support conversion of `at_least(0)
|
215
|
-
* Add `-f` shorthand for `--force` option
|
218
|
+
* Support conversion of `at_least(0)`.
|
219
|
+
* Add `-f` shorthand for `--force` option.
|
216
220
|
|
217
221
|
## v0.0.9
|
218
222
|
|
219
|
-
* Use `--disable allow_to_receive` to disable conversion from `obj.should_receive(:foo).any_number_of_times` to `allow(obj).to receive(:foo)` (Previously it was `--disable expect_to_receive`)
|
223
|
+
* Use `--disable allow_to_receive` to disable conversion from `obj.should_receive.(:foo).any_number_of_times` to `allow(obj).to receive(:foo)` (Previously it was `--disable expect_to_receive`)
|
220
224
|
|
221
225
|
## v0.0.8
|
222
226
|
|
223
|
-
* Support conversion from `not_to raise_error(SpecificErrorClass)` to `not_to raise_error
|
227
|
+
* Support conversion from `not_to raise_error(SpecificErrorClass)` to `not_to raise_error`.
|
224
228
|
|
225
229
|
## v0.0.7
|
226
230
|
|
227
|
-
* Avoid confusing `Typhoeus.stub` with RSpec's `stub
|
231
|
+
* Avoid confusing `Typhoeus.stub` with RSpec's `stub`. ([#4](https://github.com/yujinakayama/transpec/issues/4))
|
228
232
|
|
229
233
|
## v0.0.6
|
230
234
|
|
231
|
-
* Fix a bug where `SomeClass.any_instance.should_receive(:message).any_number_of_times` was converted into `expect_any_instance_of(SomeClass).to receive(:message)` unintentionally (now it's converted into `allow_any_instance_of(SomeClass).to receive(:message)`)
|
235
|
+
* Fix a bug where `SomeClass.any_instance.should_receive.(:message).any_number_of_times` was converted into `expect_any_instance_of(SomeClass).to receive(:message)` unintentionally (now it's converted into `allow_any_instance_of(SomeClass).to receive(:message)`)
|
232
236
|
|
233
237
|
## v0.0.5
|
234
238
|
|
235
|
-
* Support conversion of `any_number_of_times
|
239
|
+
* Support conversion of `any_number_of_times`.
|
236
240
|
|
237
241
|
## v0.0.4
|
238
242
|
|
239
|
-
* Fix a bug where necessary parentheses were not added when converting operator matcher to non-operator matcher in some cases (e.g. `== (2 - 1) + (1 + 2)` was converted into `eq(2 - 1) + (1 + 2)` unintentionally)
|
243
|
+
* Fix a bug where necessary parentheses were not added when converting operator matcher to non-operator matcher in some cases. (e.g. `== (2 - 1) + (1 + 2)` was converted into `eq(2 - 1) + (1 + 2)` unintentionally)
|
240
244
|
|
241
245
|
## v0.0.3
|
242
246
|
|
243
|
-
* Suppress addition of superfluous parentheses when converting operator matcher that have argument in parentheses to non-operator matcher (e.g. from `== (2 - 1)` to `eq(2 - 1)`)
|
244
|
-
* Support auto-modification of syntax configuration in `RSpec.configure
|
247
|
+
* Suppress addition of superfluous parentheses when converting operator matcher that have argument in parentheses to non-operator matcher. (e.g. from `== (2 - 1)` to `eq(2 - 1)`)
|
248
|
+
* Support auto-modification of syntax configuration in `RSpec.configure`.
|
245
249
|
|
246
250
|
## v0.0.2
|
247
251
|
|
248
|
-
* Support conversion from `be_close(expected, delta)` to `be_within(delta).of(expected)
|
252
|
+
* Support conversion from `be_close(expected, delta)` to `be_within(delta).of(expected)`.
|
249
253
|
|
250
254
|
## v0.0.1
|
251
255
|
|
252
|
-
* Initial release
|
256
|
+
* Initial release.
|
data/README.md
CHANGED
@@ -133,6 +133,8 @@ Running dynamic analysis with command "bundle exec rspec"...
|
|
133
133
|
Finished in 13.07 seconds
|
134
134
|
100 examples, 0 failures
|
135
135
|
|
136
|
+
Aggregating spec suite data...
|
137
|
+
|
136
138
|
Converting spec/spec_helper.rb
|
137
139
|
Converting spec/support/cache_helper.rb
|
138
140
|
Converting spec/support/file_helper.rb
|
@@ -275,6 +277,7 @@ but the new syntaxes provide more modern and clear ways.
|
|
275
277
|
Type | Target Syntax | Converted Syntax
|
276
278
|
-----------------|--------------------------------|----------------------------------------------------
|
277
279
|
`example_group` | `describe 'something' { }` | `RSpec.describe 'something' { }`
|
280
|
+
`hook_scope` | `before(:all) { }` | `before(:context) { }`
|
278
281
|
`stub_with_hash` | `obj.stub(:message => value)` | `allow(obj).to receive(:message).and_return(value)`
|
279
282
|
|
280
283
|
Note: Specifying `stub_with_hash` enables conversion of `obj.stub(:message => value)`
|
@@ -476,7 +479,8 @@ The one-liner (implicit receiver) `should`:
|
|
476
479
|
* [Pending examples](#pending-examples)
|
477
480
|
* [Current example object](#current-example-object)
|
478
481
|
* [Custom matcher DSL](#custom-matcher-dsl)
|
479
|
-
* [Example
|
482
|
+
* [Example groups](#example-groups)
|
483
|
+
* [Hook scope aliases](#hook-scope-aliases)
|
480
484
|
|
481
485
|
### Standard expectations
|
482
486
|
|
@@ -527,7 +531,7 @@ feel free to disable this conversion and continue using the one-liner `should`.
|
|
527
531
|
See [Two Types of `should`](#two-types-of-should) also.
|
528
532
|
|
529
533
|
* This conversion can be disabled by: `--keep oneliner`
|
530
|
-
* Deprecation:
|
534
|
+
* Deprecation: not deprecated
|
531
535
|
* See also: [Add `is_expected` for expect-based one-liner syntax. by myronmarston · rspec/rspec-core](https://github.com/rspec/rspec-core/pull/1180)
|
532
536
|
|
533
537
|
### Operator matchers
|
@@ -625,6 +629,7 @@ expect(collection).to have(3).items
|
|
625
629
|
expect(collection).to have_exactly(3).items
|
626
630
|
expect(collection).to have_at_least(3).items
|
627
631
|
expect(collection).to have_at_most(3).items
|
632
|
+
|
628
633
|
collection.should have(3).items
|
629
634
|
|
630
635
|
# Assume `team` responds to #players.
|
@@ -638,9 +643,12 @@ Will be converted to:
|
|
638
643
|
|
639
644
|
```ruby
|
640
645
|
expect(collection.size).to eq(3)
|
646
|
+
expect(collection.size).to eq(3)
|
641
647
|
expect(collection.size).to be >= 3
|
642
648
|
expect(collection.size).to be <= 3
|
643
|
-
|
649
|
+
|
650
|
+
# With `--keep should`
|
651
|
+
collection.size.should == 3
|
644
652
|
|
645
653
|
expect(team.players.size).to eq(3)
|
646
654
|
|
@@ -887,7 +895,7 @@ allow(obj).to receive_messages(:foo => 1, :bar => 2)
|
|
887
895
|
obj.stub(:foo => 1, :bar => 2) # No conversion
|
888
896
|
|
889
897
|
# If the target project's RSpec is prior to 3.0.0.beta1
|
890
|
-
# and `--convert
|
898
|
+
# and `--convert stub-with-hash` is specified
|
891
899
|
allow(obj).to receive(:foo).and_return(1)
|
892
900
|
allow(obj).to receive(:bar).and_return(2)
|
893
901
|
```
|
@@ -919,8 +927,9 @@ obj.unstub!(:message)
|
|
919
927
|
Will be converted to:
|
920
928
|
|
921
929
|
```ruby
|
922
|
-
|
923
|
-
obj.
|
930
|
+
# With `--keep stub`
|
931
|
+
obj.stub(:message)
|
932
|
+
obj.unstub(:message)
|
924
933
|
```
|
925
934
|
|
926
935
|
* This conversion can be disabled by: `--keep deprecated`
|
@@ -1229,7 +1238,7 @@ end
|
|
1229
1238
|
* Deprecation: deprecated since RSpec 3.0
|
1230
1239
|
* See also: [Expectations: Matcher protocol and custom matcher API changes - The Plan for RSpec 3](http://myronmars.to/n/dev-blog/2013/07/the-plan-for-rspec-3#expectations_matcher_protocol_and_custom_matcher_api_changes)
|
1231
1240
|
|
1232
|
-
### Example
|
1241
|
+
### Example groups
|
1233
1242
|
|
1234
1243
|
**This conversion is disabled by default and available only if your project's RSpec is `3.0.0.beta2` or later.**
|
1235
1244
|
|
@@ -1265,9 +1274,44 @@ end
|
|
1265
1274
|
```
|
1266
1275
|
|
1267
1276
|
* This conversion can be enabled by: `--convert example_group`
|
1268
|
-
* Deprecation:
|
1277
|
+
* Deprecation: not deprecated
|
1269
1278
|
* See also: [Zero Monkey Patching Mode! - The Plan for RSpec 3](http://myronmars.to/n/dev-blog/2013/07/the-plan-for-rspec-3#zero_monkey_patching_mode)
|
1270
1279
|
|
1280
|
+
### Hook scope aliases
|
1281
|
+
|
1282
|
+
**This conversion is disabled by default and available only if your project's RSpec is `3.0.0.beta2` or later.**
|
1283
|
+
|
1284
|
+
Targets:
|
1285
|
+
|
1286
|
+
```ruby
|
1287
|
+
describe 'example' do
|
1288
|
+
before { do_something }
|
1289
|
+
before(:each) { do_something }
|
1290
|
+
before(:all) { do_something }
|
1291
|
+
end
|
1292
|
+
|
1293
|
+
RSpec.configure do |config|
|
1294
|
+
before(:suite) { do_something }
|
1295
|
+
end
|
1296
|
+
```
|
1297
|
+
|
1298
|
+
Will be converted to:
|
1299
|
+
|
1300
|
+
```ruby
|
1301
|
+
describe 'example' do
|
1302
|
+
before { do_something }
|
1303
|
+
before(:example) { do_something }
|
1304
|
+
before(:context) { do_something }
|
1305
|
+
end
|
1306
|
+
|
1307
|
+
RSpec.configure do |config|
|
1308
|
+
before(:suite) { do_something }
|
1309
|
+
end
|
1310
|
+
```
|
1311
|
+
|
1312
|
+
* This conversion can be enabled by: `--convert hook_scope`
|
1313
|
+
* Deprecation: not deprecated
|
1314
|
+
* See also: [Adds hook scope aliases `example` and `context` · rspec/rspec-core](https://github.com/rspec/rspec-core/pull/1174)
|
1271
1315
|
|
1272
1316
|
## Compatibility
|
1273
1317
|
|