Skip to content

Instantly share code, notes, and snippets.

@iGEL
Created July 12, 2017 09:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iGEL/82cd7f46cce177857038f3d583c8f780 to your computer and use it in GitHub Desktop.
Save iGEL/82cd7f46cce177857038f3d583c8f780 to your computer and use it in GitHub Desktop.
diff --git a/spec/rubocop/cop/style/lambda_call_spec.rb b/spec/rubocop/cop/style/lambda_call_spec.rb
index abbd89c..93d37b9 100644
--- a/spec/rubocop/cop/style/lambda_call_spec.rb
+++ b/spec/rubocop/cop/style/lambda_call_spec.rb
@@ -61,5 +61,15 @@ describe RuboCop::Cop::Style::LambdaCall, :config do
new_source = autocorrect_source(['a.call(x)'])
expect(new_source).to eq('a.(x)')
end
+
+ it 'auto-corrects x.call to x.()' do
+ new_source = autocorrect_source(['a.call'])
+ expect(new_source).to eq('a.()')
+ end
+
+ it 'auto-corrects x.call asdf, x123 to x.(asdf, x123)' do
+ new_source = autocorrect_source(['a.call asdf, x123'])
+ expect(new_source).to eq('a.(asdf, x123)')
+ end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment