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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 89106c8a70598e1c56947bcb35e207db8839317c
4
- data.tar.gz: 3333ebd452e3be727f9261d815f7ecbf6200a5fa
3
+ metadata.gz: ac09b384ab7befe26402897d24ed3bec504a312b
4
+ data.tar.gz: e71fc56132b0380abb1224ea572b4f820dba6ed6
5
5
  SHA512:
6
- metadata.gz: 1c05920d4e39d10bf6c5dd15ad1d2075cb95d7e8a5e9a6becab4e1ac768688b19c2e2010c063d5dc58af0f9224fd72fbe0921cf34d229fd7b0ca4c7e1ad3ed69
7
- data.tar.gz: d58f9e39daebde5544b9efbdb5172d54e00bd4c5160aad57d5dff28571ce85eec84b05d01d25af0d2342c1731a9b5c4d7309e1034517704b2a82517e5dd9b2b6
6
+ metadata.gz: 85a7267b190392bd92cd89c99963b9d12a53612aa8bf84ff868a48f82f4326fd537a52a455e130b3431de11ca7b369c41d53c213d4d6bcdc26e6e1252305fe3b
7
+ data.tar.gz: ffbaa0389ed3e64d2d5f9c7225ab0f90b36e42436956f6da8af071c62bda297ab8dbc9d3f064db616a4411281fd54faa1b832fca2d2c3160719f8c7cf08d7fdb
data/.rubocop.yml CHANGED
@@ -79,3 +79,6 @@ ClassLength:
79
79
  # This cop should consider symmetries.
80
80
  GuardClause:
81
81
  Enabled: false
82
+
83
+ ModuleLength:
84
+ Enabled: false
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.pre1
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
- * The version of Ruby you're using (`ruby --version`)
10
- * The version of Transpec you're using (`transpec --version`)
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](http://img.shields.io/gem/v/transpec.svg?style=flat)](http://badge.fury.io/rb/transpec)
2
- [![Dependency Status](http://img.shields.io/gemnasium/yujinakayama/transpec.svg?style=flat)](https://gemnasium.com/yujinakayama/transpec)
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](http://img.shields.io/coveralls/yujinakayama/transpec/master.svg?style=flat)](https://coveralls.io/r/yujinakayama/transpec)
5
- [![Code Climate](https://img.shields.io/codeclimate/github/yujinakayama/transpec.svg?style=flat)](https://codeclimate.com/github/yujinakayama/transpec)
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
- Tested on MRI 1.9, 2.0, 2.1, 2.2 and JRuby in 1.9 mode.
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](http://img.shields.io/gem/v/transpec.svg?style=flat)](http://badge.fury.io/rb/transpec)
2
- [![Dependency Status](http://img.shields.io/gemnasium/yujinakayama/transpec.svg?style=flat)](https://gemnasium.com/yujinakayama/transpec)
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](http://img.shields.io/coveralls/yujinakayama/transpec/master.svg?style=flat)](https://coveralls.io/r/yujinakayama/transpec)
5
- [![Code Climate](https://img.shields.io/codeclimate/github/yujinakayama/transpec.svg?style=flat)](https://codeclimate.com/github/yujinakayama/transpec)
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
- Tested on MRI 1.9, 2.0, 2.1, 2.2 and JRuby in 1.9 mode.
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, project, config)
86
+ converter = Converter.new(spec_suite, config)
87
87
  converter.convert_file!(spec)
88
88
 
89
89
  warn_annotations(converter.report)
@@ -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, project = nil, config = 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
@@ -69,7 +69,7 @@ module Transpec
69
69
  private
70
70
 
71
71
  def rainbow
72
- @rainbow ||= Rainbow.new
72
+ @rainbow ||= Rainbow.new
73
73
  end
74
74
 
75
75
  def colorize(string, *args)
@@ -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.loc.expression.source
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? # rubocop:disable NonNilCheck
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
- return unless parent_node.children.first.equal?(child_node)
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
@@ -5,7 +5,7 @@ module Transpec
5
5
  module Version
6
6
  MAJOR = 3
7
7
  MINOR = 1
8
- PATCH = 0
8
+ PATCH = 1
9
9
 
10
10
  def self.to_s
11
11
  [MAJOR, MINOR, PATCH].join('.')
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.0
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-03-01 00:00:00.000000000 Z
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.5
240
+ rubygems_version: 2.4.8
241
241
  signing_key:
242
242
  specification_version: 4
243
243
  summary: The RSpec syntax converter