-
Notifications
You must be signed in to change notification settings - Fork 16
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
Add enrich_li_class for nested tasklist #29
Changes from all commits
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 |
---|---|---|
|
@@ -52,6 +52,36 @@ module VimwikiMarkdown | |
expect(wiki_body.to_s).to match(/<a href="there.html">there<\/a>/) | ||
end | ||
|
||
it "must enrich task list unchecked" do | ||
allow_any_instance_of(VimwikiMarkdown::VimwikiLink).to receive(:vimwiki_markdown_file_exists?).and_return(true) | ||
allow(wiki_body).to receive(:get_wiki_markdown_contents).and_return("- [ ] This is one line") | ||
expect(wiki_body.to_s).to match(/<li class="done0"> This is one line<\/li>/) | ||
end | ||
|
||
it "must enrich task list checked" do | ||
allow_any_instance_of(VimwikiMarkdown::VimwikiLink).to receive(:vimwiki_markdown_file_exists?).and_return(true) | ||
allow(wiki_body).to receive(:get_wiki_markdown_contents).and_return("- [X] This is a checked line") | ||
expect(wiki_body.to_s).to match(/<li class="done4"> This is a checked line<\/li>/) | ||
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/RegexpLiteral: Use %r around regular expression. |
||
end | ||
|
||
it "must enrich task list parent 1" do | ||
allow_any_instance_of(VimwikiMarkdown::VimwikiLink).to receive(:vimwiki_markdown_file_exists?).and_return(true) | ||
allow(wiki_body).to receive(:get_wiki_markdown_contents).and_return("- [.] This is a parent 1 line") | ||
expect(wiki_body.to_s).to match(/<li class="done1"> This is a parent 1 line<\/li>/) | ||
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/RegexpLiteral: Use %r around regular expression. |
||
end | ||
|
||
it "must enrich task list parent 2" do | ||
allow_any_instance_of(VimwikiMarkdown::VimwikiLink).to receive(:vimwiki_markdown_file_exists?).and_return(true) | ||
allow(wiki_body).to receive(:get_wiki_markdown_contents).and_return("- [o] This is a parent 2 line") | ||
expect(wiki_body.to_s).to match(/<li class="done2"> This is a parent 2 line<\/li>/) | ||
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/RegexpLiteral: Use %r around regular expression. |
||
end | ||
|
||
it "must enrich task list parent 3" do | ||
allow_any_instance_of(VimwikiMarkdown::VimwikiLink).to receive(:vimwiki_markdown_file_exists?).and_return(true) | ||
allow(wiki_body).to receive(:get_wiki_markdown_contents).and_return("- [O] This is a parent 3 line") | ||
expect(wiki_body.to_s).to match(/<li class="done3"> This is a parent 3 line<\/li>/) | ||
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/RegexpLiteral: Use %r around regular expression. |
||
end | ||
|
||
describe "syntax highlighting" do | ||
it "must give correct classes" do | ||
allow(wiki_body).to receive(:get_wiki_markdown_contents) | ||
|
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/RegexpLiteral: Use %r around regular expression.