Skip to content

Commit

Permalink
Merge pull request #31 from Shopify/seb/glyph-chevron
Browse files Browse the repository at this point in the history
Add chevron glyph, to be used for debug output
  • Loading branch information
lavoiesl authored May 16, 2018
2 parents 34d1ee6 + 860fe07 commit 245cce6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/cli/ui/glyph.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ def initialize(handle, codepoint, color)
X = new('x', 0x2717, Color::RED)
# Bug emoji (🐛)
BUG = new('b', 0x1f41b, Color::WHITE)
# RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK (»)
CHEVRON = new('>', 0xbb, Color::YELLOW)

# Looks up a glyph by name
#
Expand Down
2 changes: 2 additions & 0 deletions test/cli/ui/glyph_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ def test_glyphs
assert_equal("\x1b[32m✓\x1b[0m", Glyph::CHECK.to_s)
assert_equal("\x1b[31m✗\x1b[0m", Glyph::X.to_s)
assert_equal("\x1b[97m🐛\x1b[0m", Glyph::BUG.to_s)
assert_equal("\x1b[33m»\x1b[0m", Glyph::CHEVRON.to_s)

assert_equal(Glyph::STAR, Glyph.lookup('*'))
assert_equal(Glyph::INFO, Glyph.lookup('i'))
assert_equal(Glyph::QUESTION, Glyph.lookup('?'))
assert_equal(Glyph::CHECK, Glyph.lookup('v'))
assert_equal(Glyph::X, Glyph.lookup('x'))
assert_equal(Glyph::BUG, Glyph.lookup('b'))
assert_equal(Glyph::CHEVRON, Glyph.lookup('>'))

assert_raises(Glyph::InvalidGlyphHandle) do
Glyph.lookup('$')
Expand Down

0 comments on commit 245cce6

Please sign in to comment.