Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ def to_rdoc

def to_yard
res = ""
res += sprintf("# @!attribute #{name}") + "\n"
res += "# @!attribute #{name}\n"

ruby_class = if @column.respond_to?(:array) && @column.array
"Array<#{map_col_type_to_ruby_classes(type)}>"
else
map_col_type_to_ruby_classes(type)
end

res += sprintf("# @return [#{ruby_class}]")
res += "# @return [#{ruby_class}]"

res
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,20 @@
is_expected.to eq(expected_result)
end

context "when the comment includes a percent sign" do
let(:column) { mock_column("id", :integer, comment: "100% complete") }
let(:expected_result) do
<<~COLUMN.strip
# @!attribute id(100% complete)
# @return [Integer]
COLUMN
end

it "returns the column annotation" do
is_expected.to eq(expected_result)
end
end

context "when position of column comment is set to `rightmost_column`" do
let(:position_of_column_comment) { :rightmost_column }
it {
Expand Down
Loading