rubocop-rspec 1.4.0 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +1 -1
- data/lib/rubocop/cop/rspec/describe_class.rb +2 -1
- data/lib/rubocop/rspec/inject.rb +4 -6
- data/lib/rubocop/rspec/version.rb +1 -1
- data/rubocop-rspec.gemspec +5 -4
- data/spec/rubocop/cop/rspec/describe_class_spec.rb +5 -0
- metadata +17 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4af4076d3a91d5fdb416fa1fec36c74e07998744
|
4
|
+
data.tar.gz: e9bd1905617f520629969606be3a7d7228415b3b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98850f3ef7a136727655aaf9eaaab8e889e8944f71762760def61d32c89e2690f6c6e3d519d1c82e9d7cd364796119105b82dfb7d2c17e58a9d4449fc9e6889d
|
7
|
+
data.tar.gz: dff8cba69accc6a345a681a47a8529a3830821d5a1d09b12f81250c3bc1c513c6409c9267dc658c59a11af04421bf9f42ce029239097cb14ee1915a9b170ab4e
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,12 @@
|
|
2
2
|
|
3
3
|
## master (unreleased)
|
4
4
|
|
5
|
+
## 1.4.1 (03/04/2016)
|
6
|
+
|
7
|
+
* Ignore routing specs for DescribeClass cop. ([@nijikon][])
|
8
|
+
* Move rubocop dependency to runtime. ([@nijikon][])
|
9
|
+
* Update to rubocop 0.39.0. ([@nijikon][])
|
10
|
+
|
5
11
|
## 1.4.0 (15/02/2016)
|
6
12
|
|
7
13
|
* Update to rubocop 0.37.2. ([@nijikon][])
|
data/README.md
CHANGED
@@ -38,7 +38,7 @@ Put this into your `.rubocop.yml`.
|
|
38
38
|
require: rubocop-rspec
|
39
39
|
```
|
40
40
|
|
41
|
-
Now you can run `rubocop` and it will
|
41
|
+
Now you can run `rubocop` and it will automatically load the RuboCop RSpec
|
42
42
|
cops together with the standard cops.
|
43
43
|
|
44
44
|
### Command line
|
@@ -23,6 +23,7 @@ module RuboCop
|
|
23
23
|
|
24
24
|
REQUEST_PAIR = s(:pair, s(:sym, :type), s(:sym, :request))
|
25
25
|
FEATURE_PAIR = s(:pair, s(:sym, :type), s(:sym, :feature))
|
26
|
+
ROUTING_PAIR = s(:pair, s(:sym, :type), s(:sym, :routing))
|
26
27
|
|
27
28
|
MESSAGE = 'The first argument to describe should be the class or ' \
|
28
29
|
'module being tested.'.freeze
|
@@ -33,7 +34,7 @@ module RuboCop
|
|
33
34
|
return if args[1..-1].any? do |arg|
|
34
35
|
next unless arg.hash_type?
|
35
36
|
arg.children.any? do |n|
|
36
|
-
[REQUEST_PAIR, FEATURE_PAIR].include?(n)
|
37
|
+
[REQUEST_PAIR, FEATURE_PAIR, ROUTING_PAIR].include?(n)
|
37
38
|
end
|
38
39
|
end
|
39
40
|
|
data/lib/rubocop/rspec/inject.rb
CHANGED
@@ -1,7 +1,4 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
|
3
|
-
require 'yaml'
|
4
|
-
|
5
2
|
module RuboCop
|
6
3
|
module RSpec
|
7
4
|
# Because RuboCop doesn't yet support plugins, we have to monkey patch in a
|
@@ -12,10 +9,11 @@ module RuboCop
|
|
12
9
|
)
|
13
10
|
|
14
11
|
def self.defaults!
|
15
|
-
|
12
|
+
path = File.absolute_path(DEFAULT_FILE)
|
13
|
+
hash = ConfigLoader.send(:load_yaml_configuration, path)
|
14
|
+
config = Config.new(hash, path)
|
16
15
|
puts "configuration from #{DEFAULT_FILE}" if ConfigLoader.debug?
|
17
|
-
config = ConfigLoader.merge_with_default(
|
18
|
-
|
16
|
+
config = ConfigLoader.merge_with_default(config, path)
|
19
17
|
ConfigLoader.instance_variable_set(:@default_configuration, config)
|
20
18
|
end
|
21
19
|
end
|
data/rubocop-rspec.gemspec
CHANGED
@@ -30,8 +30,9 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.test_files = spec.files.grep(%r{^spec/})
|
31
31
|
spec.extra_rdoc_files = ['MIT-LICENSE.md', 'README.md']
|
32
32
|
|
33
|
-
spec.
|
34
|
-
|
35
|
-
spec.add_development_dependency
|
36
|
-
spec.add_development_dependency
|
33
|
+
spec.add_runtime_dependency 'rubocop', '0.39.0'
|
34
|
+
|
35
|
+
spec.add_development_dependency 'rake'
|
36
|
+
spec.add_development_dependency 'rspec', '>= 3.4'
|
37
|
+
spec.add_development_dependency 'simplecov'
|
37
38
|
end
|
@@ -44,6 +44,11 @@ describe RuboCop::Cop::RSpec::DescribeClass do
|
|
44
44
|
expect(cop.offenses).to be_empty
|
45
45
|
end
|
46
46
|
|
47
|
+
it 'ignores routing specs' do
|
48
|
+
inspect_source(cop, "describe 'my new route', type: :routing do; end")
|
49
|
+
expect(cop.offenses).to be_empty
|
50
|
+
end
|
51
|
+
|
47
52
|
it "doesn't blow up on single-line describes" do
|
48
53
|
inspect_source(cop, 'describe Some::Class')
|
49
54
|
expect(cop.offenses).to be_empty
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-rspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ian MacLeod
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-04-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rubocop
|
@@ -17,56 +17,56 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - '='
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 0.
|
21
|
-
type: :
|
20
|
+
version: 0.39.0
|
21
|
+
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - '='
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 0.
|
27
|
+
version: 0.39.0
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rake
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- - "
|
32
|
+
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: '
|
34
|
+
version: '0'
|
35
35
|
type: :development
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- - "
|
39
|
+
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: '
|
41
|
+
version: '0'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: rspec
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- - "
|
46
|
+
- - ">="
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: '3.
|
48
|
+
version: '3.4'
|
49
49
|
type: :development
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
|
-
- - "
|
53
|
+
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: '3.
|
55
|
+
version: '3.4'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: simplecov
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
|
-
- - "
|
60
|
+
- - ">="
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: '0
|
62
|
+
version: '0'
|
63
63
|
type: :development
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
|
-
- - "
|
67
|
+
- - ">="
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: '0
|
69
|
+
version: '0'
|
70
70
|
description: |2
|
71
71
|
Code style checking for RSpec files.
|
72
72
|
A plugin for the RuboCop code style enforcing & linting tool.
|