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 +4 -4
- data/CHANGELOG.md +6 -0
- data/doc/code_style.md +3 -11
- data/doc/supported_assertions.md +13 -10
- data/lib/minitest_to_rspec/converter.rb +16 -1
- data/lib/minitest_to_rspec/version.rb +1 -1
- data/minitest_to_rspec.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c17ecdc9651a35fe93d7e7d22aca94077712ece4
|
4
|
+
data.tar.gz: 58727ca31c6a92dce3b77bc61b93128e7c0aac2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22156206911960548f3b02b95d478b1b0d1a21977e19d093d3f390623633455cdbe54dce6e633c3c9797f97a292fa023ce0a3daa40599635af7408d7f52525d3
|
7
|
+
data.tar.gz: 4a3dda877042d8fc3fdbf27e719ee218e012e11e55e638d616ba39a05ef2ab686c8fd0e4895f84db3aa9631e7b992e42d1a10b084c1b79e58acc7bc7ecc5424e
|
data/CHANGELOG.md
CHANGED
data/doc/code_style.md
CHANGED
@@ -1,19 +1,11 @@
|
|
1
1
|
Code Style
|
2
2
|
==========
|
3
3
|
|
4
|
-
The code style is
|
5
|
-
and is not configurable.
|
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/
|
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
|
data/doc/supported_assertions.md
CHANGED
@@ -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(
|
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
|
data/minitest_to_rspec.gemspec
CHANGED
@@ -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.
|
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.
|
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-
|
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.
|
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.
|
40
|
+
version: 0.0.3
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|