rubocop-rspec 1.29.0 → 1.29.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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5bb37f4e34447ecf1e1f30484aa0d861a624e71e60b2c21d16c67f5a20d95b13
|
4
|
+
data.tar.gz: db2a1555891ba75ac4ee956c6e9d97e85b95923edde3e7584f818d2fe2cddc85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7db598400632086657e6b590ff999aee6a9ce46e3443edaa133af3e8d0411d0669a2ed360cc05360b8748c6694ad0d5a3dd5783dc39e06be7136dcf8554673e4
|
7
|
+
data.tar.gz: 83815cc74d3261b5e05cb0d3ab760dfa0c5c3448ac0595d70392ed4d45d9ccc388c1026ae4202a72128c5945976d6eba04ac60f0729fc8c0f4df8b5a2c63e2c0
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,11 @@
|
|
2
2
|
|
3
3
|
## Master (Unreleased)
|
4
4
|
|
5
|
+
## 1.29.1 (2018-09-01)
|
6
|
+
|
7
|
+
* Fix false negative in `FactoryBot/AttributeDefinedStatically` when attribute is defined on `self`. ([@Darhazer][])
|
8
|
+
* `RSpec/FactoryBot` cops will now also inspect the `spec/factories.rb` path by default. ([@bquorning][])
|
9
|
+
|
5
10
|
## 1.29.0 (2018-08-25)
|
6
11
|
|
7
12
|
* `RSpec/InstanceVariable` - Recommend local variables in addition to `let`. ([@jaredbeck][])
|
data/config/default.yml
CHANGED
@@ -54,6 +54,18 @@ RSpec.describe RuboCop::Cop::RSpec::FactoryBot::AttributeDefinedStatically do #
|
|
54
54
|
RUBY
|
55
55
|
end
|
56
56
|
|
57
|
+
it 'registers an offense for an attribute defined on `self`' do
|
58
|
+
expect_offense(<<-RUBY)
|
59
|
+
FactoryBot.define do
|
60
|
+
factory :post do
|
61
|
+
self.start { Date.today }
|
62
|
+
self.end Date.tomorrow
|
63
|
+
^^^^^^^^^^^^^^^^^^^^^^ Use a block to declare attribute values.
|
64
|
+
end
|
65
|
+
end
|
66
|
+
RUBY
|
67
|
+
end
|
68
|
+
|
57
69
|
it 'accepts valid factory definitions' do
|
58
70
|
expect_no_offenses(<<-RUBY)
|
59
71
|
FactoryBot.define do
|
@@ -121,6 +133,7 @@ RSpec.describe RuboCop::Cop::RSpec::FactoryBot::AttributeDefinedStatically do #
|
|
121
133
|
meta_tags(foo: Time.current)
|
122
134
|
other_tags({ foo: Time.current })
|
123
135
|
options color: :blue
|
136
|
+
self.end Date.tomorrow
|
124
137
|
|
125
138
|
trait :old do
|
126
139
|
published_at 1.week.ago
|
@@ -144,6 +157,7 @@ RSpec.describe RuboCop::Cop::RSpec::FactoryBot::AttributeDefinedStatically do #
|
|
144
157
|
meta_tags { { foo: Time.current } }
|
145
158
|
other_tags { { foo: Time.current } }
|
146
159
|
options { { color: :blue } }
|
160
|
+
self.end { Date.tomorrow }
|
147
161
|
|
148
162
|
trait :old do
|
149
163
|
published_at { 1.week.ago }
|
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.29.
|
4
|
+
version: 1.29.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Backus
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2018-
|
13
|
+
date: 2018-09-01 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rubocop
|