diff --git a/spec/rubocop/cop/style/ternary_parentheses_spec.rb b/spec/rubocop/cop/style/ternary_parentheses_spec.rb index 99fe0ac31465..a427eaf53019 100644 --- a/spec/rubocop/cop/style/ternary_parentheses_spec.rb +++ b/spec/rubocop/cop/style/ternary_parentheses_spec.rb @@ -58,6 +58,10 @@ 'foo = bar && baz ? a : b', 'foo = (bar && baz) ? a : b' + it_behaves_like 'code with offense', + 'foo = foo1 == foo2 ? a : b', + 'foo = (foo1 == foo2) ? a : b' + it_behaves_like 'code with offense', 'foo = bar.baz? ? a : b', 'foo = (bar.baz?) ? a : b' @@ -101,6 +105,9 @@ 'foo = (1 + 1 == 2) ? a : b', 'foo = 1 + 1 == 2 ? a : b' + it_behaves_like 'code with offense', + 'foo = (foo1 == foo2) ? a : b' + it_behaves_like 'code with offense', 'foo = (bar && baz) ? a : b', 'foo = bar && baz ? a : b'