Skip to content

Commit bfb79f1

Browse files
committed
add spec
ref: #331
1 parent 15fc93e commit bfb79f1

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

spec/lib/rufo/formatter_source_specs/method_definition.rb.spec

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,3 +371,13 @@ end
371371
def foo(a, ...)
372372
p(...)
373373
end
374+
375+
#~# ORIGINAL issue_331
376+
def foo a:
377+
a
378+
end
379+
380+
#~# EXPECTED
381+
def foo(a:)
382+
a
383+
end

spec/lib/rufo/formatter_source_specs/method_definition_with_receiver.rb.spec

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,18 @@ def a x;x end;def b y;y end;def c z;z end # comment
6565
def a(x); x end
6666
def b(y); y end
6767
def c(z); z end # comment
68+
69+
#~# ORIGINAL issue_331
70+
#~# parens_in_def: :dynamic
71+
class User
72+
def self.by_uid uid:
73+
joins(:authentications).where(authentications: { uid: }).first
74+
end
75+
end
76+
77+
#~# EXPECTED
78+
class User
79+
def self.by_uid uid:
80+
joins(:authentications).where(authentications: { uid: }).first
81+
end
82+
end

0 commit comments

Comments
 (0)