Skip to content

Commit

Permalink
Update jekyll tests
Browse files Browse the repository at this point in the history
  • Loading branch information
colebemis committed Feb 19, 2020
1 parent 752a1e7 commit 95fd1c2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/octicons_jekyll/test/octicon_tag_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@
describe Jekyll::Octicons do
describe "parsing" do
it "parses the tag options" do
output = render("{% octicon logo-github height:32 class:\"left right\" aria-label:hi %}")
output = render("{% octicon mark-github height:32 class:\"left right\" aria-label:hi %}")
assert_match /height="32"/, output
assert_match /class="[^"]+ left right/, output
assert_match /aria-label="hi"/, output
end

it "parses interpoaltion of variables" do
template = render("{% assign symbol = \"logo-github\" %}{% octicon {{ symbol }} %}")
assert_match /<svg.*octicon-logo-github.*/, template
template = render("{% assign symbol = \"mark-github\" %}{% octicon {{ symbol }} %}")
assert_match /<svg.*octicon-mark-github.*/, template
end
end

describe "rendering" do
it "renders the svg" do
output = render("{% octicon logo-github height:32 %}")
assert_match /<svg.*octicon-logo-github.*/, output
assert_match /<svg.*width="90".*/, output
output = render("{% octicon mark-github height:32 %}")
assert_match /<svg.*octicon-mark-github.*/, output
assert_match /<svg.*width="32".*/, output
end

it "renders nothing without a symbol" do
Expand Down

0 comments on commit 95fd1c2

Please sign in to comment.