transpec 3.1.0 → 3.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/.travis.yml +2 -1
- data/CHANGELOG.md +4 -0
- data/CONTRIBUTING.md +3 -2
- data/README.md +14 -5
- data/README.md.erb +14 -5
- data/lib/transpec/cli.rb +1 -1
- data/lib/transpec/converter.rb +5 -2
- data/lib/transpec/report.rb +1 -1
- data/lib/transpec/syntax/have.rb +8 -1
- data/lib/transpec/syntax/operator.rb +1 -1
- data/lib/transpec/util.rb +1 -1
- data/lib/transpec/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac09b384ab7befe26402897d24ed3bec504a312b
|
4
|
+
data.tar.gz: e71fc56132b0380abb1224ea572b4f820dba6ed6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85a7267b190392bd92cd89c99963b9d12a53612aa8bf84ff868a48f82f4326fd537a52a455e130b3431de11ca7b369c41d53c213d4d6bcdc26e6e1252305fe3b
|
7
|
+
data.tar.gz: ffbaa0389ed3e64d2d5f9c7225ab0f90b36e42436956f6da8af071c62bda297ab8dbc9d3f064db616a4411281fd54faa1b832fca2d2c3160719f8c7cf08d7fdb
|
data/.rubocop.yml
CHANGED
data/.travis.yml
CHANGED
@@ -6,13 +6,14 @@ rvm:
|
|
6
6
|
- 2.2
|
7
7
|
- ruby-head
|
8
8
|
- jruby-19mode
|
9
|
-
- jruby-9.0.0.0
|
9
|
+
- jruby-9.0.0.0
|
10
10
|
env:
|
11
11
|
- RSPEC_VERSION=2.14
|
12
12
|
- RSPEC_VERSION=2.99
|
13
13
|
- RSPEC_VERSION=3.0
|
14
14
|
- RSPEC_VERSION=3.1
|
15
15
|
- RSPEC_VERSION=3.2
|
16
|
+
- RSPEC_VERSION=3.3
|
16
17
|
- RSPEC_VERSION=head
|
17
18
|
before_install: gem update --remote bundler
|
18
19
|
script: bundle exec rake ci
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
## Development
|
4
4
|
|
5
|
+
## v3.1.1
|
6
|
+
|
7
|
+
* Support conversion of `have(:no).items` and `have('2').items`. ([#107](https://github.com/yujinakayama/transpec/issues/107))
|
8
|
+
|
5
9
|
## v3.1.0
|
6
10
|
|
7
11
|
* Add `-o/--convert-only` option for converting specific syntaxes while keeping all other syntaxes. ([#91](https://github.com/yujinakayama/transpec/issues/91))
|
data/CONTRIBUTING.md
CHANGED
@@ -6,8 +6,9 @@ If you're going to report an issue or submit a pull request, please follow these
|
|
6
6
|
|
7
7
|
* Provide the following information:
|
8
8
|
* The problematic code or the project's URL
|
9
|
-
*
|
10
|
-
*
|
9
|
+
* Transpec version (`transpec --version`)
|
10
|
+
* RSpec version (`bundle exec rspec --version`)
|
11
|
+
* Ruby version (`ruby --version`)
|
11
12
|
* The complete command-line options you passed to `transpec`
|
12
13
|
|
13
14
|
## Pull Requests
|
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
[![Gem Version](
|
2
|
-
[![Dependency Status](
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/transpec.svg)](http://badge.fury.io/rb/transpec)
|
2
|
+
[![Dependency Status](https://gemnasium.com/yujinakayama/transpec.svg)](https://gemnasium.com/yujinakayama/transpec)
|
3
3
|
[![Build Status](https://travis-ci.org/yujinakayama/transpec.svg?branch=master&style=flat)](https://travis-ci.org/yujinakayama/transpec)
|
4
|
-
[![Coverage Status](
|
5
|
-
[![Code Climate](https://
|
4
|
+
[![Coverage Status](https://coveralls.io/repos/yujinakayama/transpec/badge.svg?branch=master&service=github)](https://coveralls.io/github/yujinakayama/transpec?branch=master)
|
5
|
+
[![Code Climate](https://codeclimate.com/github/yujinakayama/transpec/badges/gpa.svg)](https://codeclimate.com/github/yujinakayama/transpec)
|
6
6
|
|
7
7
|
# Transpec
|
8
8
|
|
@@ -1446,7 +1446,16 @@ end
|
|
1446
1446
|
|
1447
1447
|
## Compatibility
|
1448
1448
|
|
1449
|
-
|
1449
|
+
Transpec is tested on the following Ruby implementations:
|
1450
|
+
|
1451
|
+
* MRI
|
1452
|
+
* 1.9.3
|
1453
|
+
* 2.0.0
|
1454
|
+
* 2.1
|
1455
|
+
* 2.2
|
1456
|
+
* JRuby
|
1457
|
+
* 1.7 in 1.9 mode
|
1458
|
+
* 9.0.0.0
|
1450
1459
|
|
1451
1460
|
## License
|
1452
1461
|
|
data/README.md.erb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
[![Gem Version](
|
2
|
-
[![Dependency Status](
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/transpec.svg)](http://badge.fury.io/rb/transpec)
|
2
|
+
[![Dependency Status](https://gemnasium.com/yujinakayama/transpec.svg)](https://gemnasium.com/yujinakayama/transpec)
|
3
3
|
[![Build Status](https://travis-ci.org/yujinakayama/transpec.svg?branch=master&style=flat)](https://travis-ci.org/yujinakayama/transpec)
|
4
|
-
[![Coverage Status](
|
5
|
-
[![Code Climate](https://
|
4
|
+
[![Coverage Status](https://coveralls.io/repos/yujinakayama/transpec/badge.svg?branch=master&service=github)](https://coveralls.io/github/yujinakayama/transpec?branch=master)
|
5
|
+
[![Code Climate](https://codeclimate.com/github/yujinakayama/transpec/badges/gpa.svg)](https://codeclimate.com/github/yujinakayama/transpec)
|
6
6
|
|
7
7
|
# Transpec
|
8
8
|
|
@@ -1467,7 +1467,16 @@ Will be converted to:
|
|
1467
1467
|
|
1468
1468
|
## Compatibility
|
1469
1469
|
|
1470
|
-
|
1470
|
+
Transpec is tested on the following Ruby implementations:
|
1471
|
+
|
1472
|
+
* MRI
|
1473
|
+
* 1.9.3
|
1474
|
+
* 2.0.0
|
1475
|
+
* 2.1
|
1476
|
+
* 2.2
|
1477
|
+
* JRuby
|
1478
|
+
* 1.7 in 1.9 mode
|
1479
|
+
* 9.0.0.0
|
1471
1480
|
|
1472
1481
|
## License
|
1473
1482
|
|
data/lib/transpec/cli.rb
CHANGED
@@ -83,7 +83,7 @@ module Transpec
|
|
83
83
|
def convert_spec(spec, spec_suite)
|
84
84
|
puts "Converting #{spec.path}"
|
85
85
|
|
86
|
-
converter = Converter.new(spec_suite,
|
86
|
+
converter = Converter.new(spec_suite, config)
|
87
87
|
converter.convert_file!(spec)
|
88
88
|
|
89
89
|
warn_annotations(converter.report)
|
data/lib/transpec/converter.rb
CHANGED
@@ -19,13 +19,16 @@ module Transpec
|
|
19
19
|
alias_method :convert_source, :rewrite_source
|
20
20
|
alias_method :convert, :rewrite
|
21
21
|
|
22
|
-
def initialize(spec_suite = nil,
|
22
|
+
def initialize(spec_suite = nil, config = nil)
|
23
23
|
@spec_suite = spec_suite || SpecSuite.new
|
24
|
-
@project = project || Project.new
|
25
24
|
@config = config || Config.new
|
26
25
|
@report = Report.new
|
27
26
|
end
|
28
27
|
|
28
|
+
def project
|
29
|
+
spec_suite.project
|
30
|
+
end
|
31
|
+
|
29
32
|
def runtime_data
|
30
33
|
spec_suite.runtime_data
|
31
34
|
end
|
data/lib/transpec/report.rb
CHANGED
data/lib/transpec/syntax/have.rb
CHANGED
@@ -98,8 +98,15 @@ module Transpec
|
|
98
98
|
source_builder.replacement_subject_source(base_subject)
|
99
99
|
end
|
100
100
|
|
101
|
+
# https://github.com/rspec/rspec-expectations/blob/v2.14.5/lib/rspec/matchers/built_in/have.rb#L8-L12
|
101
102
|
def size_source
|
102
|
-
size_node.
|
103
|
+
if size_node.sym_type? && size_node.children.first == :no
|
104
|
+
0
|
105
|
+
elsif size_node.str_type?
|
106
|
+
size_node.children.first.to_i
|
107
|
+
else
|
108
|
+
size_node.loc.expression.source
|
109
|
+
end
|
103
110
|
end
|
104
111
|
|
105
112
|
def accurate_conversion?
|
@@ -90,7 +90,7 @@ module Transpec
|
|
90
90
|
|
91
91
|
parenthesize!(parenthesize_arg)
|
92
92
|
|
93
|
-
accurate = !using_match_array?.nil?
|
93
|
+
accurate = !using_match_array?.nil?
|
94
94
|
|
95
95
|
# Need to register record after all source rewrites are done
|
96
96
|
# to avoid false record when failed with overlapped rewrite.
|
data/lib/transpec/util.rb
CHANGED
@@ -105,7 +105,7 @@ module Transpec
|
|
105
105
|
yield origin_node if mode == :include_origin
|
106
106
|
|
107
107
|
origin_node.each_ancestor(:send, :block).reduce(origin_node) do |child_node, parent_node|
|
108
|
-
|
108
|
+
break unless parent_node.children.first.equal?(child_node)
|
109
109
|
|
110
110
|
if mode == :child_as_second_arg
|
111
111
|
yield parent_node, child_node
|
data/lib/transpec/version.rb
CHANGED
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: 3.1.
|
4
|
+
version: 3.1.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: 2015-
|
11
|
+
date: 2015-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parser
|
@@ -237,7 +237,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
237
237
|
version: '0'
|
238
238
|
requirements: []
|
239
239
|
rubyforge_project:
|
240
|
-
rubygems_version: 2.4.
|
240
|
+
rubygems_version: 2.4.8
|
241
241
|
signing_key:
|
242
242
|
specification_version: 4
|
243
243
|
summary: The RSpec syntax converter
|