transpec 3.1.1 → 3.1.2

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: ac09b384ab7befe26402897d24ed3bec504a312b
4
- data.tar.gz: e71fc56132b0380abb1224ea572b4f820dba6ed6
3
+ metadata.gz: 44f63928b496b5321e12052717fbc2e36b188afc
4
+ data.tar.gz: 0b973547b5d53ebdc06537549f215e1ab792f34a
5
5
  SHA512:
6
- metadata.gz: 85a7267b190392bd92cd89c99963b9d12a53612aa8bf84ff868a48f82f4326fd537a52a455e130b3431de11ca7b369c41d53c213d4d6bcdc26e6e1252305fe3b
7
- data.tar.gz: ffbaa0389ed3e64d2d5f9c7225ab0f90b36e42436956f6da8af071c62bda297ab8dbc9d3f064db616a4411281fd54faa1b832fca2d2c3160719f8c7cf08d7fdb
6
+ metadata.gz: 19448fdd37e53d08a9bbcccc98e3dc286a3cb5b5efa90282caa610d52eb27a56683c198d3c7d4f43ab8ebed1bc820703f9f781f9e8787ff1550de425789db98f
7
+ data.tar.gz: ad721bebc30ec06ac03de43ee75903e5d906a9c7202527b8fdf458d94a77146eb2b839ab93518f3a6b4b9eff53c940954b8d7bc3cec56a8f302311a4aed1f5a4
data/.travis.yml CHANGED
@@ -11,10 +11,11 @@ env:
11
11
  - RSPEC_VERSION=2.14
12
12
  - RSPEC_VERSION=2.99
13
13
  - RSPEC_VERSION=3.0
14
- - RSPEC_VERSION=3.1
15
- - RSPEC_VERSION=3.2
16
- - RSPEC_VERSION=3.3
14
+ - RSPEC_VERSION=3.4
17
15
  - RSPEC_VERSION=head
16
+ matrix:
17
+ allow_failures:
18
+ - rvm: ruby-head
18
19
  before_install: gem update --remote bundler
19
20
  script: bundle exec rake ci
20
21
  sudo: false
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Development
4
4
 
5
+ ## v3.1.2
6
+
7
+ * Avoid converting invalid `have` matcher without `items` part. ([#108](https://github.com/yujinakayama/transpec/issues/108))
8
+
5
9
  ## v3.1.1
6
10
 
7
11
  * Support conversion of `have(:no).items` and `have('2').items`. ([#107](https://github.com/yujinakayama/transpec/issues/107))
data/README.md CHANGED
@@ -14,9 +14,9 @@ Also, you can use it on your RSpec 2 project even if you're not going to upgrade
14
14
 
15
15
  Check out the following posts for the new RSpec syntax and the changes in RSpec 3:
16
16
 
17
- * [Myron Marston » RSpec's New Expectation Syntax](http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax)
18
- * [RSpec's new message expectation syntax - Tea is awesome.](http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/)
19
- * [Myron Marston » Notable Changes in RSpec 3](http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3)
17
+ * [RSpec's New Expectation Syntax](http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/)
18
+ * [RSpec's new message expectation syntax](http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/)
19
+ * [Notable Changes in RSpec 3](http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/)
20
20
 
21
21
  If you are going to use Transpec in the upgrade process to RSpec 3,
22
22
  read the RSpec official guide:
@@ -216,6 +216,9 @@ For this reason, it's recommended to provide a command that runs full spec suite
216
216
  If you want to convert only a subset of the files in a spec suite, pass the paths to `transpec`.
217
217
  See [Advanced Usage](#advanced-usage) for more details.
218
218
 
219
+ You can change the temporary directory that the your project will be copied
220
+ by specifying the `TMPDIR` environment variable.
221
+
219
222
  ```bash
220
223
  $ transpec --rspec-command "./special_setup.sh && bundle exec rspec"
221
224
  ```
@@ -457,7 +460,7 @@ The monkey-patched `obj.should`:
457
460
 
458
461
  * Is defined on `BasicObject` (or `Kernel`) and provided by `rspec-expectations` gem.
459
462
  * Is deprecated in RSpec 3.
460
- * Has [the issue](http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax#delegation_issues) with delegate/proxy objects.
463
+ * Has [the issue](http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/#delegation-issues) with delegate/proxy objects.
461
464
  * There's the alternative syntax [`expect(obj).to`](#standard-expectations) since RSpec 2.11.
462
465
 
463
466
  The one-liner (implicit receiver) `should`:
@@ -483,11 +486,11 @@ The one-liner (implicit receiver) `should`:
483
486
  * [Message expectations that are actually method stubs](#message-expectations-that-are-actually-method-stubs)
484
487
  * [Method stubs](#method-stubs)
485
488
  * [Method stubs with a hash argument](#method-stubs-with-a-hash-argument)
486
- * [Deprecated method stub aliases](#deprecated-method-stub-aliases)
489
+ * [Method stub aliases](#method-stub-aliases)
487
490
  * [Method stubs with deprecated specification of number of times](#method-stubs-with-deprecated-specification-of-number-of-times)
488
491
  * [Useless `and_return`](#useless-and_return)
489
492
  * [`any_instance` implementation blocks](#any_instance-implementation-blocks)
490
- * [Deprecated test double aliases](#deprecated-test-double-aliases)
493
+ * [Test double aliases](#test-double-aliases)
491
494
  * [Pending examples](#pending-examples)
492
495
  * [Current example object](#current-example-object)
493
496
  * [Custom matcher DSL](#custom-matcher-dsl)
@@ -515,7 +518,7 @@ expect(obj).to_not matcher # with `--negative-form to_not`
515
518
 
516
519
  * This conversion can be disabled by: `--keep should`
517
520
  * Deprecation: deprecated since RSpec 3.0
518
- * See also: [Myron Marston » RSpec's New Expectation Syntax](http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax)
521
+ * See also: [RSpec's New Expectation Syntax](http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/)
519
522
 
520
523
  ### One-liner expectations
521
524
 
@@ -572,7 +575,7 @@ expect([1, 2, 3]).to match_array([2, 1, 3])
572
575
 
573
576
  This conversion is combined with the conversion of [standard expectations](#standard-expecatations) and cannot be disabled separately because the `expect` syntax does not directly support the operator matchers.
574
577
 
575
- * See also: [(Almost) All Matchers Are Supported - RSpec's New Expectation Syntax](http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax#almost_all_matchers_are_supported)
578
+ * See also: [(Almost) All Matchers Are Supported - RSpec's New Expectation Syntax](http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/#almost-all-matchers-are-supported)
576
579
 
577
580
  ### Boolean matchers
578
581
 
@@ -702,7 +705,7 @@ So using rspec-collection_matchers gem is recommended for now.
702
705
 
703
706
  * This conversion can be disabled by: `--keep have_items`
704
707
  * Deprecation: deprecated since RSpec 2.99, removed in RSpec 3.0
705
- * See also: [Expectations: `have(x).items` matchers will be moved into an external gem - The Plan for RSpec 3](http://myronmars.to/n/dev-blog/2013/07/the-plan-for-rspec-3#expectations__matchers_will_be_moved_into_an_external_gem)
708
+ * See also: [Expectations: `have(x).items` matchers will be moved into an external gem - The Plan for RSpec 3](http://rspec.info/blog/2013/07/the-plan-for-rspec-3/#expectations-havexitems-matchers-will-be-moved-into-an-external-gem)
706
709
 
707
710
  ### One-liner expectations with `have(n).items` matcher
708
711
 
@@ -753,7 +756,7 @@ expect { do_something }.to raise_error
753
756
 
754
757
  * This conversion can be disabled by: `--keep should`
755
758
  * Deprecation: deprecated since RSpec 3.0
756
- * See also: [Unification of Block vs. Value Syntaxes - RSpec's New Expectation Syntax](http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax#unification_of_block_vs_value_syntaxes)
759
+ * See also: [Unification of Block vs. Value Syntaxes - RSpec's New Expectation Syntax](http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/#unification-of-block-vs-value-syntaxes)
757
760
 
758
761
  ### Expectations on attribute of subject with `its`
759
762
 
@@ -808,7 +811,7 @@ Read [this post](https://gist.github.com/myronmarston/4503509) for the rationale
808
811
 
809
812
  * This conversion can be disabled by: `--keep its`
810
813
  * Deprecation: deprecated since RSpec 2.99, removed in RSpec 3.0
811
- * See also: [Core: `its` will be moved into an external gem - The Plan for RSpec 3](http://myronmars.to/n/dev-blog/2013/07/the-plan-for-rspec-3#core__will_be_moved_into_an_external_gem)
814
+ * See also: [Core: `its` will be moved into an external gem - The Plan for RSpec 3](http://rspec.info/blog/2013/07/the-plan-for-rspec-3/#core-its-will-be-moved-into-an-external-gem)
812
815
 
813
816
  ### Negative error expectations with specific error
814
817
 
@@ -850,7 +853,7 @@ expect_any_instance_of(Klass).to receive(:message)
850
853
 
851
854
  * This conversion can be disabled by: `--keep should_receive`
852
855
  * Deprecation: deprecated since RSpec 3.0
853
- * See also: [RSpec's new message expectation syntax - Tea is awesome.](http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/)
856
+ * See also: [RSpec's new message expectation syntax](http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/)
854
857
 
855
858
  ### Message expectations that are actually method stubs
856
859
 
@@ -911,7 +914,7 @@ allow(obj).to receive(:message).and_call_original
911
914
  * This conversion can be disabled by: `--keep stub`
912
915
  * Deprecation: deprecated since RSpec 3.0
913
916
  * See also:
914
- * [RSpec's new message expectation syntax - Tea is awesome.](http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/)
917
+ * [RSpec's new message expectation syntax](http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/)
915
918
  * [Bring back stub_chain (receive_message_chain) · rspec/rspec-mocks](https://github.com/rspec/rspec-mocks/issues/464)
916
919
 
917
920
  ### Method stubs with a hash argument
@@ -939,7 +942,7 @@ allow(obj).to receive(:bar).and_return(2)
939
942
 
940
943
  `allow(obj).to receive_messages(:foo => 1, :bar => 2)` which is designed to be the replacement for `obj.stub(:foo => 1, :bar => 2)` is available from RSpec 3.0.
941
944
 
942
- So, if you're going to use Transpec in [the upgrade path to RSpec 3](http://myronmars.to/n/dev-blog/2013/07/the-plan-for-rspec-3#the_upgrade_path), you may need to follow these steps:
945
+ So, if you're going to use Transpec in [the upgrade path to RSpec 3](http://rspec.info/blog/2013/07/the-plan-for-rspec-3/#the-upgrade-path), you may need to follow these steps:
943
946
 
944
947
  1. Upgrade to RSpec 2.99
945
948
  2. Run `transpec` (at this time `obj.stub(:message => value)` won't be converted)
@@ -952,7 +955,7 @@ Or if you're going to stay RSpec 2.14 for now but want to convert all `stub` to
952
955
  * Deprecation: deprecated since RSpec 3.0
953
956
  * See also: [allow receive with multiple methods · rspec/rspec-mocks](https://github.com/rspec/rspec-mocks/issues/368)
954
957
 
955
- ### Deprecated method stub aliases
958
+ ### Method stub aliases
956
959
 
957
960
  Targets:
958
961
 
@@ -1087,9 +1090,9 @@ end
1087
1090
 
1088
1091
  * This conversion can be disabled by: `--keep deprecated`
1089
1092
  * Deprecation: deprecated since RSpec 2.99
1090
- * See also: [Mocks: `any_instance` block implementations will yield the receiver](http://myronmars.to/n/dev-blog/2013/07/the-plan-for-rspec-3#mocks__block_implementations_will_yield_the_receiver)
1093
+ * See also: [Mocks: `any_instance` block implementations will yield the receiver](http://rspec.info/blog/2013/07/the-plan-for-rspec-3/#mocks-anyinstance-block-implementations-will-yield-the-receiver)
1091
1094
 
1092
- ### Deprecated test double aliases
1095
+ ### Test double aliases
1093
1096
 
1094
1097
  Targets:
1095
1098
 
@@ -1233,7 +1236,7 @@ Here's an excerpt from [the warning](https://github.com/rspec/rspec-core/blob/7d
1233
1236
 
1234
1237
  * This conversion can be disabled by: `--keep deprecated`
1235
1238
  * Deprecation: deprecated since RSpec 2.99, removed in RSpec 3.0
1236
- * See also: [Core: DSL methods will yield the example - The Plan for RSpec 3](http://myronmars.to/n/dev-blog/2013/07/the-plan-for-rspec-3#core_dsl_methods_will_yield_the_example)
1239
+ * See also: [Core: DSL methods will yield the example - The Plan for RSpec 3](http://rspec.info/blog/2013/07/the-plan-for-rspec-3/#core-dsl-methods-will-yield-the-example)
1237
1240
 
1238
1241
  ### Custom matcher DSL
1239
1242
 
@@ -1263,7 +1266,7 @@ end
1263
1266
 
1264
1267
  * This conversion can be disabled by: `--keep deprecated`
1265
1268
  * Deprecation: deprecated since RSpec 3.0
1266
- * See also: [Expectations: Matcher protocol and custom matcher API changes - The Plan for RSpec 3](http://myronmars.to/n/dev-blog/2013/07/the-plan-for-rspec-3#expectations_matcher_protocol_and_custom_matcher_api_changes)
1269
+ * See also: [Expectations: Matcher protocol and custom matcher API changes - The Plan for RSpec 3](http://rspec.info/blog/2013/07/the-plan-for-rspec-3/#expectations-matcher-protocol-and-custom-matcher-api-changes)
1267
1270
 
1268
1271
  ### Implicit spec types in rspec-rails
1269
1272
 
@@ -1406,7 +1409,7 @@ end
1406
1409
 
1407
1410
  * This conversion can be enabled by: `--convert example_group`
1408
1411
  * Deprecation: not deprecated
1409
- * See also: [Zero Monkey Patching Mode! - The Plan for RSpec 3](http://myronmars.to/n/dev-blog/2013/07/the-plan-for-rspec-3#zero_monkey_patching_mode)
1412
+ * See also: [Zero Monkey Patching Mode! - The Plan for RSpec 3](http://rspec.info/blog/2013/07/the-plan-for-rspec-3/#zero-monkey-patching-mode)
1410
1413
 
1411
1414
  ### Hook scope aliases
1412
1415
 
data/README.md.erb CHANGED
@@ -14,9 +14,9 @@ Also, you can use it on your RSpec 2 project even if you're not going to upgrade
14
14
 
15
15
  Check out the following posts for the new RSpec syntax and the changes in RSpec 3:
16
16
 
17
- * [Myron Marston » RSpec's New Expectation Syntax](http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax)
18
- * [RSpec's new message expectation syntax - Tea is awesome.](http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/)
19
- * [Myron Marston » Notable Changes in RSpec 3](http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3)
17
+ * [RSpec's New Expectation Syntax](http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/)
18
+ * [RSpec's new message expectation syntax](http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/)
19
+ * [Notable Changes in RSpec 3](http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/)
20
20
 
21
21
  If you are going to use Transpec in the upgrade process to RSpec 3,
22
22
  read the RSpec official guide:
@@ -190,6 +190,9 @@ For this reason, it's recommended to provide a command that runs full spec suite
190
190
  If you want to convert only a subset of the files in a spec suite, pass the paths to `transpec`.
191
191
  See [Advanced Usage](#advanced-usage) for more details.
192
192
 
193
+ You can change the temporary directory that the your project will be copied
194
+ by specifying the `TMPDIR` environment variable.
195
+
193
196
  ```bash
194
197
  $ transpec --rspec-command "./special_setup.sh && bundle exec rspec"
195
198
  ```
@@ -441,7 +444,7 @@ The monkey-patched `obj.should`:
441
444
 
442
445
  * Is defined on `BasicObject` (or `Kernel`) and provided by `rspec-expectations` gem.
443
446
  * Is deprecated in RSpec 3.
444
- * Has [the issue](http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax#delegation_issues) with delegate/proxy objects.
447
+ * Has [the issue](http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/#delegation-issues) with delegate/proxy objects.
445
448
  * There's the alternative syntax [`expect(obj).to`](#standard-expectations) since RSpec 2.11.
446
449
 
447
450
  The one-liner (implicit receiver) `should`:
@@ -485,7 +488,7 @@ Will be converted to:
485
488
 
486
489
  * This conversion can be disabled by: `--keep should`
487
490
  * Deprecation: deprecated since RSpec 3.0
488
- * See also: [Myron Marston » RSpec's New Expectation Syntax](http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax)
491
+ * See also: [RSpec's New Expectation Syntax](http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/)
489
492
 
490
493
  ### One-liner expectations
491
494
 
@@ -550,7 +553,7 @@ Will be converted to:
550
553
 
551
554
  This conversion is combined with the conversion of [standard expectations](#standard-expecatations) and cannot be disabled separately because the `expect` syntax does not directly support the operator matchers.
552
555
 
553
- * See also: [(Almost) All Matchers Are Supported - RSpec's New Expectation Syntax](http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax#almost_all_matchers_are_supported)
556
+ * See also: [(Almost) All Matchers Are Supported - RSpec's New Expectation Syntax](http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/#almost-all-matchers-are-supported)
554
557
 
555
558
  ### Boolean matchers
556
559
 
@@ -755,7 +758,7 @@ So using rspec-collection_matchers gem is recommended for now.
755
758
 
756
759
  * This conversion can be disabled by: `--keep have_items`
757
760
  * Deprecation: deprecated since RSpec 2.99, removed in RSpec 3.0
758
- * See also: [Expectations: `have(x).items` matchers will be moved into an external gem - The Plan for RSpec 3](http://myronmars.to/n/dev-blog/2013/07/the-plan-for-rspec-3#expectations__matchers_will_be_moved_into_an_external_gem)
761
+ * See also: [Expectations: `have(x).items` matchers will be moved into an external gem - The Plan for RSpec 3](http://rspec.info/blog/2013/07/the-plan-for-rspec-3/#expectations-havexitems-matchers-will-be-moved-into-an-external-gem)
759
762
 
760
763
  ### One-liner expectations with `have(n).items` matcher
761
764
 
@@ -824,7 +827,7 @@ Will be converted to:
824
827
 
825
828
  * This conversion can be disabled by: `--keep should`
826
829
  * Deprecation: deprecated since RSpec 3.0
827
- * See also: [Unification of Block vs. Value Syntaxes - RSpec's New Expectation Syntax](http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax#unification_of_block_vs_value_syntaxes)
830
+ * See also: [Unification of Block vs. Value Syntaxes - RSpec's New Expectation Syntax](http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/#unification-of-block-vs-value-syntaxes)
828
831
 
829
832
  ### Expectations on attribute of subject with `its`
830
833
 
@@ -863,7 +866,7 @@ Read [this post](https://gist.github.com/myronmarston/4503509) for the rationale
863
866
 
864
867
  * This conversion can be disabled by: `--keep its`
865
868
  * Deprecation: deprecated since RSpec 2.99, removed in RSpec 3.0
866
- * See also: [Core: `its` will be moved into an external gem - The Plan for RSpec 3](http://myronmars.to/n/dev-blog/2013/07/the-plan-for-rspec-3#core__will_be_moved_into_an_external_gem)
869
+ * See also: [Core: `its` will be moved into an external gem - The Plan for RSpec 3](http://rspec.info/blog/2013/07/the-plan-for-rspec-3/#core-its-will-be-moved-into-an-external-gem)
867
870
 
868
871
  ### Negative error expectations with specific error
869
872
 
@@ -916,7 +919,7 @@ Will be converted to:
916
919
 
917
920
  * This conversion can be disabled by: `--keep should_receive`
918
921
  * Deprecation: deprecated since RSpec 3.0
919
- * See also: [RSpec's new message expectation syntax - Tea is awesome.](http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/)
922
+ * See also: [RSpec's new message expectation syntax](http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/)
920
923
 
921
924
  ### Message expectations that are actually method stubs
922
925
 
@@ -1001,7 +1004,7 @@ Will be converted to:
1001
1004
  * This conversion can be disabled by: `--keep stub`
1002
1005
  * Deprecation: deprecated since RSpec 3.0
1003
1006
  * See also:
1004
- * [RSpec's new message expectation syntax - Tea is awesome.](http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/)
1007
+ * [RSpec's new message expectation syntax](http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/)
1005
1008
  * [Bring back stub_chain (receive_message_chain) · rspec/rspec-mocks](https://github.com/rspec/rspec-mocks/issues/464)
1006
1009
 
1007
1010
  ### Method stubs with a hash argument
@@ -1032,7 +1035,7 @@ Will be converted to:
1032
1035
 
1033
1036
  `allow(obj).to receive_messages(:foo => 1, :bar => 2)` which is designed to be the replacement for `obj.stub(:foo => 1, :bar => 2)` is available from RSpec 3.0.
1034
1037
 
1035
- So, if you're going to use Transpec in [the upgrade path to RSpec 3](http://myronmars.to/n/dev-blog/2013/07/the-plan-for-rspec-3#the_upgrade_path), you may need to follow these steps:
1038
+ So, if you're going to use Transpec in [the upgrade path to RSpec 3](http://rspec.info/blog/2013/07/the-plan-for-rspec-3/#the-upgrade-path), you may need to follow these steps:
1036
1039
 
1037
1040
  1. Upgrade to RSpec 2.99
1038
1041
  2. Run `transpec` (at this time `obj.stub(:message => value)` won't be converted)
@@ -1045,7 +1048,7 @@ Or if you're going to stay RSpec 2.14 for now but want to convert all `stub` to
1045
1048
  * Deprecation: deprecated since RSpec 3.0
1046
1049
  * See also: [allow receive with multiple methods · rspec/rspec-mocks](https://github.com/rspec/rspec-mocks/issues/368)
1047
1050
 
1048
- ### Deprecated method stub aliases
1051
+ ### Method stub aliases
1049
1052
 
1050
1053
  Targets:
1051
1054
 
@@ -1156,9 +1159,9 @@ Or with `--no-yield-any-instance` option they will be converted to:
1156
1159
 
1157
1160
  * This conversion can be disabled by: `--keep deprecated`
1158
1161
  * Deprecation: deprecated since RSpec 2.99
1159
- * See also: [Mocks: `any_instance` block implementations will yield the receiver](http://myronmars.to/n/dev-blog/2013/07/the-plan-for-rspec-3#mocks__block_implementations_will_yield_the_receiver)
1162
+ * See also: [Mocks: `any_instance` block implementations will yield the receiver](http://rspec.info/blog/2013/07/the-plan-for-rspec-3/#mocks-anyinstance-block-implementations-will-yield-the-receiver)
1160
1163
 
1161
- ### Deprecated test double aliases
1164
+ ### Test double aliases
1162
1165
 
1163
1166
  Targets:
1164
1167
 
@@ -1287,7 +1290,7 @@ Here's an excerpt from [the warning](https://github.com/rspec/rspec-core/blob/7d
1287
1290
 
1288
1291
  * This conversion can be disabled by: `--keep deprecated`
1289
1292
  * Deprecation: deprecated since RSpec 2.99, removed in RSpec 3.0
1290
- * See also: [Core: DSL methods will yield the example - The Plan for RSpec 3](http://myronmars.to/n/dev-blog/2013/07/the-plan-for-rspec-3#core_dsl_methods_will_yield_the_example)
1293
+ * See also: [Core: DSL methods will yield the example - The Plan for RSpec 3](http://rspec.info/blog/2013/07/the-plan-for-rspec-3/#core-dsl-methods-will-yield-the-example)
1291
1294
 
1292
1295
  ### Custom matcher DSL
1293
1296
 
@@ -1316,7 +1319,7 @@ Will be converted to:
1316
1319
 
1317
1320
  * This conversion can be disabled by: `--keep deprecated`
1318
1321
  * Deprecation: deprecated since RSpec 3.0
1319
- * See also: [Expectations: Matcher protocol and custom matcher API changes - The Plan for RSpec 3](http://myronmars.to/n/dev-blog/2013/07/the-plan-for-rspec-3#expectations_matcher_protocol_and_custom_matcher_api_changes)
1322
+ * See also: [Expectations: Matcher protocol and custom matcher API changes - The Plan for RSpec 3](http://rspec.info/blog/2013/07/the-plan-for-rspec-3/#expectations-matcher-protocol-and-custom-matcher-api-changes)
1320
1323
 
1321
1324
  ### Implicit spec types in rspec-rails
1322
1325
 
@@ -1431,7 +1434,7 @@ Will be converted to:
1431
1434
 
1432
1435
  * This conversion can be enabled by: `--convert example_group`
1433
1436
  * Deprecation: not deprecated
1434
- * See also: [Zero Monkey Patching Mode! - The Plan for RSpec 3](http://myronmars.to/n/dev-blog/2013/07/the-plan-for-rspec-3#zero_monkey_patching_mode)
1437
+ * See also: [Zero Monkey Patching Mode! - The Plan for RSpec 3](http://rspec.info/blog/2013/07/the-plan-for-rspec-3/#zero-monkey-patching-mode)
1435
1438
 
1436
1439
  ### Hook scope aliases
1437
1440
 
@@ -190,8 +190,8 @@ module Transpec
190
190
  # rubocop:enable AlignHash
191
191
 
192
192
  def highlight_text(text)
193
- text.gsub(/`.+?`/) { |code| code.gsub('`', '').underline }
194
- .gsub(/\*.+?\*/) { |code| code.gsub('*', '').bright }
193
+ text.gsub(/`.+?`/) { |code| code.delete('`').underline }
194
+ .gsub(/\*.+?\*/) { |code| code.delete('*').bright }
195
195
  end
196
196
 
197
197
  def convert_deprecated_options(raw_args)
@@ -100,7 +100,7 @@ module Transpec
100
100
 
101
101
  def special_block_type(block_node) # rubocop:disable MethodLength, CyclomaticComplexity
102
102
  send_node = block_node.children.first
103
- receiver_node, method_name, *_ = *send_node
103
+ receiver_node, method_name, = *send_node
104
104
 
105
105
  if const_name(receiver_node) == 'RSpec'
106
106
  case method_name
@@ -127,7 +127,7 @@ module Transpec
127
127
  end
128
128
 
129
129
  def hook_type(send_node)
130
- _, method_name, arg_node, *_ = *send_node
130
+ _, method_name, arg_node, = *send_node
131
131
 
132
132
  return :around if method_name == :around
133
133
 
@@ -25,7 +25,8 @@ module Transpec
25
25
  def dynamic_analysis_target?
26
26
  super &&
27
27
  receiver_node.nil? &&
28
- [:have, :have_exactly, :have_at_least, :have_at_most].include?(method_name)
28
+ [:have, :have_exactly, :have_at_least, :have_at_most].include?(method_name) &&
29
+ node.sibling_index == 0
29
30
  end
30
31
 
31
32
  def conversion_target?
@@ -29,7 +29,7 @@ module Transpec
29
29
 
30
30
  @block_node = rspec_configure.block_node.each_descendant(:block).find do |block_node|
31
31
  send_node = block_node.children.first
32
- receiver_node, method_name, *_ = *send_node
32
+ receiver_node, method_name, = *send_node
33
33
  next unless receiver_node == s(:lvar, rspec_configure.block_arg_name)
34
34
  method_name == block_method_name
35
35
  # TODO: Check expectation framework.
@@ -85,7 +85,7 @@ module Transpec
85
85
  end
86
86
 
87
87
  if rspec_version.config_backtrace_formatter_available?
88
- replace_config!(:backtrace_cleaner, :backtrace_formatter)
88
+ replace_config!(:backtrace_cleaner, :backtrace_formatter)
89
89
  end
90
90
 
91
91
  if rspec_version.config_predicate_color_enabled_available?
data/lib/transpec/util.rb CHANGED
@@ -16,7 +16,7 @@ module Transpec
16
16
  return false unless node.block_type?
17
17
 
18
18
  send_node = node.children.first
19
- receiver_node, method_name, *_ = *send_node
19
+ receiver_node, method_name, = *send_node
20
20
 
21
21
  if receiver_node.nil? || const_name(receiver_node) == 'Kernel'
22
22
  [:lambda, :proc].include?(method_name)
@@ -162,14 +162,14 @@ module Transpec
162
162
 
163
163
  def literal?(node)
164
164
  case node.type
165
- when *LITERAL_TYPES
166
- true
167
165
  when :array, :irange, :erange
168
166
  node.children.all? { |n| literal?(n) }
169
167
  when :hash
170
168
  node.children.all? do |pair_node|
171
169
  pair_node.children.all? { |n| literal?(n) }
172
170
  end
171
+ when *LITERAL_TYPES
172
+ true
173
173
  else
174
174
  false
175
175
  end
@@ -5,7 +5,7 @@ module Transpec
5
5
  module Version
6
6
  MAJOR = 3
7
7
  MINOR = 1
8
- PATCH = 1
8
+ PATCH = 2
9
9
 
10
10
  def self.to_s
11
11
  [MAJOR, MINOR, PATCH].join('.')
data/tasks/ci.rake CHANGED
@@ -3,7 +3,7 @@
3
3
  tasks = %w(spec)
4
4
 
5
5
  if RSpec::Core::Version::STRING.start_with?('2.14') && RUBY_ENGINE != 'jruby'
6
- tasks.concat(%w(style readme:check travis:validate_matrix test:all))
6
+ tasks.concat(%w(style readme:check test:all))
7
7
  end
8
8
 
9
9
  task ci: tasks
data/tasks/readme.rake CHANGED
@@ -149,7 +149,7 @@ class READMEContext
149
149
  end.compact
150
150
 
151
151
  titles.map do |title|
152
- anchor = '#' + title.gsub(/[^\w_\- ]/, '').downcase.gsub(' ', '-')
152
+ anchor = '#' + title.gsub(/[^\w_\- ]/, '').downcase.tr(' ', '-')
153
153
  "* [#{title}](#{anchor})"
154
154
  end.join("\n")
155
155
  end
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.1
4
+ version: 3.1.2
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-07-29 00:00:00.000000000 Z
11
+ date: 2015-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parser
@@ -215,7 +215,6 @@ files:
215
215
  - tasks/readme.rake
216
216
  - tasks/spec.rake
217
217
  - tasks/test.rake
218
- - tasks/travis.rake
219
218
  - transpec.gemspec
220
219
  homepage: http://yujinakayama.me/transpec/
221
220
  licenses:
@@ -237,7 +236,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
237
236
  version: '0'
238
237
  requirements: []
239
238
  rubyforge_project:
240
- rubygems_version: 2.4.8
239
+ rubygems_version: 2.5.1
241
240
  signing_key:
242
241
  specification_version: 4
243
242
  summary: The RSpec syntax converter
data/tasks/travis.rake DELETED
@@ -1,38 +0,0 @@
1
- # coding: utf-8
2
-
3
- namespace :travis do
4
- desc 'Validate completeness of available RSpec versions in .travis.yml'
5
- task :validate_matrix do
6
- require 'open-uri'
7
- require 'json'
8
- require 'yaml'
9
-
10
- json = URI.parse('https://rubygems.org/api/v1/versions/rspec.json').read
11
- gem_versions = JSON.parse(json)
12
-
13
- available_versions = gem_versions.map do |version|
14
- major, minor, _patch, _suffix = version['number'].split('.')
15
- [major, minor].join('.')
16
- end.uniq.sort
17
-
18
- minimum_support_version = Gem::Version.new('2.14')
19
- available_versions.reject! { |version| Gem::Version.new(version) < minimum_support_version }
20
-
21
- travis_config = YAML.load_file('.travis.yml')
22
-
23
- travis_versions = travis_config['env'].map do |pair|
24
- key, value = pair.split('=')
25
- next unless key == 'RSPEC_VERSION'
26
- next if value == 'head'
27
- value
28
- end.compact.sort
29
-
30
- if travis_versions == available_versions
31
- puts 'All the available RSpec versions are covered in .travis.yml.'
32
- else
33
- fail "The current available RSpec versions are not covered in .travis.yml!\n" \
34
- " Available Versions: #{available_versions}\n" \
35
- " Versions in .travis.yml: #{travis_versions}"
36
- end
37
- end
38
- end