diff --git a/spec/lib/rufo/formatter_source_specs/method_definition.rb.spec b/spec/lib/rufo/formatter_source_specs/method_definition.rb.spec index c0d995be..bdf487f8 100644 --- a/spec/lib/rufo/formatter_source_specs/method_definition.rb.spec +++ b/spec/lib/rufo/formatter_source_specs/method_definition.rb.spec @@ -371,3 +371,13 @@ end def foo(a, ...) p(...) end + +#~# ORIGINAL issue_331 +def foo a: + a +end + +#~# EXPECTED +def foo(a:) + a +end diff --git a/spec/lib/rufo/formatter_source_specs/method_definition_with_receiver.rb.spec b/spec/lib/rufo/formatter_source_specs/method_definition_with_receiver.rb.spec index c497d363..48e4416c 100644 --- a/spec/lib/rufo/formatter_source_specs/method_definition_with_receiver.rb.spec +++ b/spec/lib/rufo/formatter_source_specs/method_definition_with_receiver.rb.spec @@ -65,3 +65,18 @@ def a x;x end;def b y;y end;def c z;z end # comment def a(x); x end def b(y); y end def c(z); z end # comment + +#~# ORIGINAL issue_331 +#~# parens_in_def: :dynamic +class User + def self.by_uid uid: + joins(:authentications).where(authentications: { uid: }).first + end +end + +#~# EXPECTED +class User + def self.by_uid uid: + joins(:authentications).where(authentications: { uid: }).first + end +end