Skip to content

Commit 965a7ed

Browse files
authored
Restrict separator as type (#245)
1 parent eea116e commit 965a7ed

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/ruby_ui/separator/separator.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class Separator < Base
77
def initialize(as: :div, orientation: :horizontal, decorative: true, **attrs)
88
raise ArgumentError, "Invalid orientation: #{orientation}" unless ORIENTATIONS.include?(orientation.to_sym)
99

10-
@as = as.to_sym
10+
@as = as
1111
@orientation = orientation.to_sym
1212
@decorative = decorative
1313
super(**attrs)

test/ruby_ui/separator_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def test_render_with_decorative_false
3131

3232
def test_render_with_custom_tag
3333
output = phlex do
34-
RubyUI.Separator(as: "hr")
34+
RubyUI.Separator(as: :hr)
3535
end
3636

3737
assert_match(/<hr/, output)

0 commit comments

Comments
 (0)