minitest_to_rspec 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 265d35e67e77ee31bae7acc313f3968d07799e52
4
- data.tar.gz: c7a5a26dfdb3d2e6275d702586ec319a125c5074
3
+ metadata.gz: c17ecdc9651a35fe93d7e7d22aca94077712ece4
4
+ data.tar.gz: 58727ca31c6a92dce3b77bc61b93128e7c0aac2e
5
5
  SHA512:
6
- metadata.gz: 7544fbb50ee02a275a0e9d8cda04d1d10b927a8431c7e99b1a2d1a5d60e497f8013e0b2915b9f45684ae160573df1a0b77e9db644bde40016f6dd1011d1becf7
7
- data.tar.gz: fee5e6be9a7e20414b808c5a1f453a0bbea8c68cc5a01a7f50f3d53c3419d5494a8046e0a5485ee25c134e1753713700813c22cce4a1bca195eb0eeef90bc441
6
+ metadata.gz: 22156206911960548f3b02b95d478b1b0d1a21977e19d093d3f390623633455cdbe54dce6e633c3c9797f97a292fa023ce0a3daa40599635af7408d7f52525d3
7
+ data.tar.gz: 4a3dda877042d8fc3fdbf27e719ee218e012e11e55e638d616ba39a05ef2ab686c8fd0e4895f84db3aa9631e7b992e42d1a10b084c1b79e58acc7bc7ecc5424e
data/CHANGELOG.md CHANGED
@@ -4,6 +4,12 @@ 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.6.1
8
+ -----
9
+
10
+ ### Fixed
11
+ - Improve output: Fewer unnecessary parentheses
12
+
7
13
  0.6.0
8
14
  -----
9
15
 
data/doc/code_style.md CHANGED
@@ -1,19 +1,11 @@
1
1
  Code Style
2
2
  ==========
3
3
 
4
- The code style is whatever [ruby2ruby][1] feels like printing,
5
- and is not configurable. The goal is not style, but to get to
6
- rspec quickly.
4
+ The code style is mostly determined by [sexp2ruby][1],
5
+ and is not configurable yet.
7
6
 
8
7
  To clean up the style a bit afterwards, here are some tips.
9
8
 
10
- 1. Remove parenthesis around `describe` and `it` arguments.
11
-
12
- ```
13
- Find: (context|describe|it)\((['"])(.*)['"]\) do
14
- Replace: $1 $2$3$2 do
15
- ```
16
-
17
9
  1. Convert `be_truthy` to [predicate matchers][2].
18
10
 
19
11
  ```
@@ -28,5 +20,5 @@ Find: expect\(\(not (.*).valid\?\)\)\.to\(be_truthy\)
28
20
  Replace: expect($1).to be_invalid
29
21
  ```
30
22
 
31
- [1]: https://github.com/seattlerb/ruby2ruby
23
+ [1]: https://github.com/jaredbeck/sexp2ruby
32
24
  [2]: https://relishapp.com/rspec/rspec-expectations/v/3-2/docs/built-in-matchers/predicate-matchers
@@ -4,16 +4,6 @@ Supported Assertions
4
4
  A quick survey of one mid-sized test suite (14 kilolines) found
5
5
  the following assertions in use.
6
6
 
7
- ```bash
8
- find test -type f -name '*.rb' | xargs cat > all_tests;
9
- for a in $( cat ~/Desktop/assertions ); do
10
- echo -n $a
11
- ggrep -E "\\b$a\\b" all_tests | wc -l
12
- done |
13
- awk '{print $2 " " $1}' |
14
- sort -nr
15
- ```
16
-
17
7
  ```
18
8
  625 assert
19
9
  530 assert_equal
@@ -58,3 +48,16 @@ sort -nr
58
48
 
59
49
  Assertions which are not used in the targeted test suite
60
50
  are not yet supported, but contributions are welcome.
51
+
52
+ A Script to Count Assertions
53
+ ----------------------------
54
+
55
+ ```bash
56
+ find test -type f -name '*.rb' | xargs cat > all_tests;
57
+ for a in $( cat ~/Desktop/assertions ); do
58
+ echo -n $a
59
+ ggrep -E "\\b$a\\b" all_tests | wc -l
60
+ done |
61
+ awk '{print $2 " " $1}' |
62
+ sort -nr
63
+ ```
@@ -5,6 +5,18 @@ 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
+ ]
19
+
8
20
  def initialize(options)
9
21
  @options = options
10
22
  @processor = Processor.new(@options[:rails])
@@ -36,7 +48,10 @@ module MinitestToRspec
36
48
  end
37
49
 
38
50
  def renderer
39
- Sexp2Ruby::Processor.new(hash_syntax: :ruby19)
51
+ Sexp2Ruby::Processor.new(
52
+ hash_syntax: :ruby19,
53
+ no_paren_methods: NO_PAREN_METHODS
54
+ )
40
55
  end
41
56
  end
42
57
  end
@@ -1,3 +1,3 @@
1
1
  module MinitestToRspec
2
- VERSION = "0.6.0".freeze
2
+ VERSION = "0.6.1".freeze
3
3
  end
@@ -26,7 +26,7 @@ ruby2ruby.
26
26
  spec.required_ruby_version = ">= 2.0.0"
27
27
 
28
28
  spec.add_runtime_dependency "ruby_parser", "~> 3.7"
29
- spec.add_runtime_dependency "sexp2ruby", "~> 0.0.2"
29
+ spec.add_runtime_dependency "sexp2ruby", "~> 0.0.3"
30
30
 
31
31
  # Required runtime dep: trollop > f7009b45,
32
32
  # but gemspec does not support git :(
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.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jared Beck
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-09 00:00:00.000000000 Z
11
+ date: 2015-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby_parser
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.0.2
33
+ version: 0.0.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.2
40
+ version: 0.0.3
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement