summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-09-16 09:07:24 +0000
committerRémy Coutable <remy@rymai.me>2016-09-16 09:07:24 +0000
commit70faf5fdfbfa0e427b12d4181a9302394974c3cf (patch)
tree335d46ef347465e287e76f441de7ed7f59703f66
parent2307eb84dcd1748cc231719017551111310d1bf9 (diff)
parent2dbcd0eb97562a60480d8dd86b10af580cc52ef5 (diff)
downloadgitlab-ce-70faf5fdfbfa0e427b12d4181a9302394974c3cf.tar.gz
Merge branch 'rs-update-rubocop-rspec' into 'master'
Bump rubocop-rspec to 1.7.0 See merge request !6357
-rw-r--r--.rubocop.yml77
-rw-r--r--Gemfile2
-rw-r--r--Gemfile.lock6
3 files changed, 71 insertions, 14 deletions
diff --git a/.rubocop.yml b/.rubocop.yml
index 5bd31ccf329..b054675d677 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -767,26 +767,33 @@ Rails/ScopeArgs:
RSpec/AnyInstance:
Enabled: false
-# Check that the first argument to the top level describe is the tested class or
-# module.
+# Check for expectations where `be(...)` can replace `eql(...)`.
+RSpec/BeEql:
+ Enabled: false
+
+# Check that the first argument to the top level describe is a constant.
RSpec/DescribeClass:
Enabled: false
-# Use `described_class` for tested class / module.
+# Checks that tests use `described_class`.
+RSpec/DescribedClass:
+ Enabled: false
+
+# Checks that the second argument to `describe` specifies a method.
RSpec/DescribeMethod:
Enabled: false
-# Checks that the second argument to top level describe is the tested method
-# name.
-RSpec/DescribedClass:
+# Checks if an example group does not include any tests.
+RSpec/EmptyExampleGroup:
Enabled: false
+ CustomIncludeMethods: []
-# Checks for long example.
+# Checks for long examples.
RSpec/ExampleLength:
Enabled: false
Max: 5
-# Do not use should when describing your tests.
+# Checks that example descriptions do not start with "should".
RSpec/ExampleWording:
Enabled: false
CustomTransform:
@@ -795,6 +802,10 @@ RSpec/ExampleWording:
not: does not
IgnoredWords: []
+# Checks for `expect(...)` calls containing literal values.
+RSpec/ExpectActual:
+ Enabled: false
+
# Checks the file and folder naming of the spec file.
RSpec/FilePath:
Enabled: false
@@ -806,19 +817,65 @@ RSpec/FilePath:
RSpec/Focus:
Enabled: true
+# Checks the arguments passed to `before`, `around`, and `after`.
+RSpec/HookArgument:
+ Enabled: false
+ EnforcedStyle: implicit
+
+# Check that a consistent implict expectation style is used.
+# TODO (rspeicher): Available in rubocop-rspec 1.8.0
+# RSpec/ImplicitExpect:
+# Enabled: true
+# EnforcedStyle: is_expected
+
# Checks for the usage of instance variables.
RSpec/InstanceVariable:
Enabled: false
-# Checks for multiple top-level describes.
+# Checks for `subject` definitions that come after `let` definitions.
+RSpec/LeadingSubject:
+ Enabled: false
+
+# Checks unreferenced `let!` calls being used for test setup.
+RSpec/LetSetup:
+ Enabled: false
+
+# Check that chains of messages are not being stubbed.
+RSpec/MessageChain:
+ Enabled: false
+
+# Checks for consistent message expectation style.
+RSpec/MessageExpectation:
+ Enabled: false
+ EnforcedStyle: allow
+
+# Checks for multiple top level describes.
RSpec/MultipleDescribes:
Enabled: false
-# Enforces the usage of the same method on all negative message expectations.
+# Checks if examples contain too many `expect` calls.
+RSpec/MultipleExpectations:
+ Enabled: false
+ Max: 1
+
+# Checks for explicitly referenced test subjects.
+RSpec/NamedSubject:
+ Enabled: false
+
+# Checks for nested example groups.
+RSpec/NestedGroups:
+ Enabled: false
+ MaxNesting: 2
+
+# Checks for consistent method usage for negating expectations.
RSpec/NotToNot:
EnforcedStyle: not_to
Enabled: true
+# Checks for stubbed test subjects.
+RSpec/SubjectStub:
+ Enabled: false
+
# Prefer using verifying doubles over normal doubles.
RSpec/VerifiedDoubles:
Enabled: false
diff --git a/Gemfile b/Gemfile
index 70d8495325f..1f83f8c83f2 100644
--- a/Gemfile
+++ b/Gemfile
@@ -296,7 +296,7 @@ group :development, :test do
gem 'spring-commands-teaspoon', '~> 0.0.2'
gem 'rubocop', '~> 0.42.0', require: false
- gem 'rubocop-rspec', '~> 1.5.0', require: false
+ gem 'rubocop-rspec', '~> 1.7.0', require: false
gem 'scss_lint', '~> 0.47.0', require: false
gem 'haml_lint', '~> 0.18.2', require: false
gem 'simplecov', '0.12.0', require: false
diff --git a/Gemfile.lock b/Gemfile.lock
index e2b5a58d973..1edb218373d 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -625,8 +625,8 @@ GEM
rainbow (>= 1.99.1, < 3.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
- rubocop-rspec (1.5.0)
- rubocop (>= 0.40.0)
+ rubocop-rspec (1.7.0)
+ rubocop (>= 0.42.0)
ruby-fogbugz (0.2.1)
crack (~> 0.4)
ruby-prof (0.15.9)
@@ -945,7 +945,7 @@ DEPENDENCIES
rspec-rails (~> 3.5.0)
rspec-retry (~> 0.4.5)
rubocop (~> 0.42.0)
- rubocop-rspec (~> 1.5.0)
+ rubocop-rspec (~> 1.7.0)
ruby-fogbugz (~> 0.2.1)
ruby-prof (~> 0.15.9)
sanitize (~> 2.0)