-
-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix indent bug for tables without headers (issue piotrmurach/tty-table/issues/45) #44
base: master
Are you sure you want to change the base?
Changes from 3 commits
b06bbed
50109dd
159ab74
3f65e61
eb30c65
43da1ae
99c09c8
5c8f9a2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,3 +37,17 @@ | |
end | ||
end | ||
end | ||
|
||
RSpec.describe TTY::Table::Renderer::ASCII, 'indentation without headers' do | ||
it "indents top border correctly" do | ||
table = TTY::Table.new | ||
table << ["a1","a2","a3"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style/WordArray: Use %w or %W for an array of words. |
||
table << ["b1","b2","b3"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style/WordArray: Use %w or %W for an array of words. |
||
expect(table.render(:ascii, indent: 3)).to eql([ | ||
" +--+--+--+", | ||
" |a1|a2|a3|", | ||
" |b1|b2|b3|", | ||
" +--+--+--+" | ||
].join("\n")) | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.