Fix RuboCop 0.40 linter errors (#1722)

These errors are breaking the build, which seems to use RuboCop 0.40 [1]
despite the Gemfile.lock pinning rubocop to 0.38.

New lints that I am updating the code style to reflect:

- Style/EmptyCaseCondition: Do not use empty case condition, instead use
  an if expression.

- Style/MultilineArrayBraceLayout: Closing array brace must be on the
  same line as the last array element when opening brace is on the same
  line as the first array element.

- Style/MultilineHashBraceLayout: Closing hash brace must be on the same
  line as the last hash element when opening brace is on the same line
  as the first hash element.

- Style/MultilineMethodCallBraceLayout: Closing method call brace must
  be on the line after the last argument when opening brace is on a
  separate line from the first argument.

[1] https://github.com/bbatsov/rubocop/releases/tag/v0.40.0
This commit is contained in:
Noah Silas
2016-05-26 09:58:05 -07:00
committed by L. Preston Sego III
parent 8a3196d920
commit 94db09b3f6
14 changed files with 147 additions and 133 deletions

View File

@@ -100,7 +100,8 @@ module ActionController
get :render_array_using_explicit_serializer_and_custom_serializers
expected = [
{ 'title' => 'New Post',
{
'title' => 'New Post',
'body' => 'Body',
'id' => assigns(:post).id,
'comments' => [{ 'id' => 1 }, { 'id' => 2 }],

View File

@@ -7,8 +7,8 @@ module ActionController
def test_active_model_with_multiple_errors
get :render_resource_with_errors
expected_errors_object =
{ :errors =>
expected_errors_object = {
:errors =>
[
{ :source => { :pointer => '/data/attributes/name' }, :detail => 'cannot be nil' },
{ :source => { :pointer => '/data/attributes/name' }, :detail => 'must be longer' },

View File

@@ -294,7 +294,8 @@ module ActionController
comments: [
{
id: 1,
body: 'ZOMG A COMMENT' }
body: 'ZOMG A COMMENT'
}
],
blog: {
id: 999,
@@ -333,7 +334,8 @@ module ActionController
comments: [
{
id: 1,
body: 'ZOMG A COMMENT' }
body: 'ZOMG A COMMENT'
}
],
blog: {
id: 999,
@@ -407,7 +409,8 @@ module ActionController
comments: [
{
id: 1,
body: 'ZOMG A COMMENT' }
body: 'ZOMG A COMMENT'
}
],
blog: {
id: 999,