minitest_to_rspec 0.7.1 → 0.8.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a44d60bad5a0cb758c25862d1737497fa1c7efe9
4
- data.tar.gz: 406146633e3d0abefe4f02e88b0c1d48233f2e53
3
+ metadata.gz: faa035369b21f564bdb2b69d3bfe572d04ed7de6
4
+ data.tar.gz: 5e63cd797b3ebe3b82d8dc66a857576eb8ce3d87
5
5
  SHA512:
6
- metadata.gz: da5f6a050e22ae6a74e9f7366cd7576a9d0ab297814aa9fa3426d8d663d3c0775744deb722870cade29b7841634d33477895c8f48bac9a3926929780fd753dbb
7
- data.tar.gz: 573d6aa172492ab68373a441480eb0a2b65396c4c994193b91a84f48047c2db33c4238b4610d5415c90a611ddaf86015828452eaa29fb932edf0fb21fe34d777
6
+ metadata.gz: 4922f99d97fa6de7a3be364417916479b463f5e31295dd4b87cd85927aedc776530126721d12f40b995a564955adf9dbad9ea37d7594ad1e3687b33c85cbaa46
7
+ data.tar.gz: ed33dca73e303c2de5b989313e894f1bc8dac0c4df4c082e717c9ffd2d48b39e6d7ec3349bf9213142fc2ea4f4522feed61f5688125319ca87186b00bba3e38f
data/.rubocop.yml CHANGED
@@ -2,5 +2,5 @@ inherit_from: .rubocop_todo.yml
2
2
 
3
3
  AllCops:
4
4
  Exclude:
5
- - spec/fixtures/**/in.rb # we should lint out.rb though
5
+ - spec/fixtures/**/*
6
6
  TargetRubyVersion: 2.0
data/.travis.yml CHANGED
@@ -1,8 +1,9 @@
1
1
  language: ruby
2
2
  rvm:
3
- - "2.0.0-p598"
4
- - "2.1.6"
5
- - "2.2.2"
3
+ - "2.1.10"
4
+ - "2.2.6"
5
+ - "2.3.3"
6
+ - "2.4.0"
6
7
  script: bundle exec rake
7
8
  notifications:
8
9
  email: false
data/CHANGELOG.md CHANGED
@@ -4,6 +4,23 @@ Change Log
4
4
  This project follows [semver 2.0.0][1] and the recommendations
5
5
  of [keepachangelog.com][2].
6
6
 
7
+ 0.8.0
8
+ -----
9
+
10
+ ### Changed
11
+
12
+ - No longer care about code style of output. See discussion in readme.
13
+ - Drop support for ruby 2.0
14
+
15
+ ### Added
16
+
17
+ - Update ruby_parser to 3.8 (was 3.7)
18
+ - Use the official ruby2ruby instead of my sketchy sexp2ruby fork
19
+
20
+ ### Fixed
21
+
22
+ None
23
+
7
24
  0.7.1
8
25
  -----
9
26
 
data/README.md CHANGED
@@ -28,15 +28,17 @@ end
28
28
  Output:
29
29
 
30
30
  ```ruby
31
- require "spec_helper"
32
- RSpec.describe Array do
33
- it "changes length" do
31
+ require("spec_helper")
32
+ RSpec.describe(Array) do
33
+ it("changes length") do
34
34
  ary = []
35
- expect { ary.push(:x) }.to change { ary.length }
35
+ expect { ary.push(:x) }.to(change { ary.length })
36
36
  end
37
37
  end
38
38
  ```
39
39
 
40
+ You might not like the code style of the output. More on that below.
41
+
40
42
  ## Install
41
43
 
42
44
  ```bash
@@ -63,10 +65,12 @@ converter.convert("assert('banana')")
63
65
 
64
66
  ## Output
65
67
 
66
- The primary goal is correctness, but [code style][34] is also important. To
67
- allow us to configure our output, we use [sexp2ruby][33] instead of
68
- [ruby2ruby][6]. As [sexp2ruby][33] adds more configuration options, we'll make
69
- use of them.
68
+ The only goal is correctness. [Code style][34] is not a consideration.
69
+ Providing the level of configuration necessary to make everyone happy would
70
+ be a huge distraction from the main purpose.
71
+
72
+ After conversion, I recommend using [rubocop][35]'s awesome `--auto-correct`
73
+ feature to apply your preferred code style.
70
74
 
71
75
  Comments are discarded by [ruby_parser][14], so we have no way of
72
76
  preserving them.
@@ -112,7 +116,7 @@ To do: [at_least, never, raises, etc.][30]
112
116
  This project would not be possible without [ruby_parser][14],
113
117
  [sexp_processor][15], and [ruby2ruby][16] by [Ryan Davis][17].
114
118
 
115
- [1]: https://travis-ci.org/jaredbeck/minitest_to_rspec.svg
119
+ [1]: https://travis-ci.org/jaredbeck/minitest_to_rspec.svg?branch=master
116
120
  [2]: https://travis-ci.org/jaredbeck/minitest_to_rspec
117
121
  [3]: https://codeclimate.com/github/jaredbeck/minitest_to_rspec/badges/gpa.svg
118
122
  [4]: https://codeclimate.com/github/jaredbeck/minitest_to_rspec
@@ -144,5 +148,5 @@ This project would not be possible without [ruby_parser][14],
144
148
  [30]: http://www.rubydoc.info/github/floehopper/mocha/Mocha/Expectation
145
149
  [31]: http://www.rubydoc.info/github/floehopper/mocha/Mocha/Expectation#once-instance_method
146
150
  [32]: http://www.rubydoc.info/github/floehopper/mocha/Mocha/Expectation#twice-instance_method
147
- [33]: https://github.com/jaredbeck/sexp2ruby
148
151
  [34]: https://github.com/bbatsov/ruby-style-guide
152
+ [35]: https://github.com/bbatsov/rubocop
@@ -1,24 +1,10 @@
1
1
  require "ruby_parser"
2
- require "sexp2ruby"
2
+ require "ruby2ruby"
3
3
  require_relative "processor"
4
4
  require_relative "errors"
5
5
 
6
6
  module MinitestToRspec
7
7
  class Converter
8
- NO_PAREN_METHODS = %i[
9
- context
10
- delete
11
- describe
12
- get
13
- include
14
- it
15
- post
16
- put
17
- require
18
- to
19
- to_not
20
- ]
21
-
22
8
  def initialize(rails: false, mocha: false)
23
9
  @processor = Processor.new(rails, mocha)
24
10
  end
@@ -53,10 +39,7 @@ module MinitestToRspec
53
39
  end
54
40
 
55
41
  def renderer
56
- Sexp2Ruby::Processor.new(
57
- hash_syntax: :ruby19,
58
- no_paren_methods: NO_PAREN_METHODS
59
- )
42
+ Ruby2Ruby.new
60
43
  end
61
44
  end
62
45
  end
@@ -1,3 +1,3 @@
1
1
  module MinitestToRspec
2
- VERSION = "0.7.1".freeze
2
+ VERSION = "0.8.0".freeze
3
3
  end
@@ -21,10 +21,10 @@ A command-line tool for converting minitest files to rspec.
21
21
  f.match(%r{^(test|spec|features)/})
22
22
  }
23
23
  spec.require_paths = ["lib"]
24
- spec.required_ruby_version = ">= 2.0.0"
24
+ spec.required_ruby_version = ">= 2.1.0"
25
25
 
26
- spec.add_runtime_dependency "ruby_parser", "~> 3.7"
27
- spec.add_runtime_dependency "sexp2ruby", "~> 0.0.4"
26
+ spec.add_runtime_dependency "ruby_parser", "~> 3.8"
27
+ spec.add_runtime_dependency "ruby2ruby", "~> 2.3"
28
28
  spec.add_runtime_dependency "trollop", "~> 2.1"
29
29
 
30
30
  spec.add_development_dependency "bundler", "~> 1.7"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest_to_rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jared Beck
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-09 00:00:00.000000000 Z
11
+ date: 2017-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby_parser
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '3.7'
19
+ version: '3.8'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '3.7'
26
+ version: '3.8'
27
27
  - !ruby/object:Gem::Dependency
28
- name: sexp2ruby
28
+ name: ruby2ruby
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.0.4
33
+ version: '2.3'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.0.4
40
+ version: '2.3'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: trollop
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -164,9 +164,8 @@ dependencies:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
166
  version: 0.2.4
167
- description: 'A command-line tool for converting minitest files to rspec.
168
-
169
- '
167
+ description: |
168
+ A command-line tool for converting minitest files to rspec.
170
169
  email:
171
170
  - jared@jaredbeck.com
172
171
  executables:
@@ -186,7 +185,6 @@ files:
186
185
  - Rakefile
187
186
  - bin/console
188
187
  - bin/mt2rspec
189
- - doc/code_style.md
190
188
  - doc/minitest.md
191
189
  - doc/rspec.md
192
190
  - doc/supported_assertions.md
@@ -222,7 +220,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
222
220
  requirements:
223
221
  - - ">="
224
222
  - !ruby/object:Gem::Version
225
- version: 2.0.0
223
+ version: 2.1.0
226
224
  required_rubygems_version: !ruby/object:Gem::Requirement
227
225
  requirements:
228
226
  - - ">="
@@ -230,7 +228,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
230
228
  version: '0'
231
229
  requirements: []
232
230
  rubyforge_project:
233
- rubygems_version: 2.5.1
231
+ rubygems_version: 2.2.5
234
232
  signing_key:
235
233
  specification_version: 4
236
234
  summary: Converts minitest files to rspec
data/doc/code_style.md DELETED
@@ -1,24 +0,0 @@
1
- Code Style
2
- ==========
3
-
4
- The code style is mostly determined by [sexp2ruby][1],
5
- and is not configurable yet.
6
-
7
- To clean up the style a bit afterwards, here are some tips.
8
-
9
- 1. Convert `be_truthy` to [predicate matchers][2].
10
-
11
- ```
12
- Find: expect\((.*).valid\?\)\.to\(be_truthy\)
13
- Replace: expect($1).to be_valid
14
- ```
15
-
16
- And the negated variant:
17
-
18
- ```
19
- Find: expect\(\(not (.*).valid\?\)\)\.to\(be_truthy\)
20
- Replace: expect($1).to be_invalid
21
- ```
22
-
23
- [1]: https://github.com/jaredbeck/sexp2ruby
24
- [2]: https://relishapp.com/rspec/rspec-expectations/v/3-2/docs/built-in-matchers/predicate-matchers