spec/mastalk_spec.rb in mastalk-0.1.2 vs spec/mastalk_spec.rb in mastalk-0.2.0
- old
+ new
@@ -71,14 +71,38 @@
context 'with newline as end' do
let(:source) { "$yes-no\n [y] yes \n [n] no \n $end $why\n###header\nbody\n$why" }
let(:expected) do
- "<ul class=\"yes-no\">\n \n<li class=\"yes\">yes</li>\n\n<li class=\"no\">no</li>\n\n\n</ul>\n<div class=\"why\">
+ "<ul class=\"yes-no\">\n \n <li class=\"yes\">yes</li>\n\n <li class=\"no\">no</li>\n\n \n</ul>\n<div class=\"why\">
<h3 id=\"header\">header</h3>\n<p>body</p>\n\n</div>\n"
end
it 'pre-processes custom tags' do
+ expect(subject.to_html).to eq(expected)
+ end
+ end
+
+ context 'two matches after each other' do
+ let(:source) { "$yes-no\n [y] yes \n $end $yes-no\ [n] no \n $end" }
+
+ let(:expected) do
+ "<ul class=\"yes-no\">\n \n <li class=\"yes\">yes</li>\n\n \n</ul>\n<ul class=\"yes-no\">\n <li class=\"no\">no</li>\n\n \n</ul>\n"
+ end
+
+ it 'pre-processes correctly' do
+ expect(subject.to_html).to eq(expected)
+ end
+ end
+
+ context 'two callouts after each other' do
+ let(:source) { "$~callout\n ##yes ~$ $~callout\n ##yes ~$" }
+
+ let(:expected) do
+ "<div class=\"callout\">\n <h2 id=\"yes\">yes</h2>\n\n</div>\n<div class=\"callout\">\n <h2 id=\"yes\">yes</h2>\n\n</div>\n"
+ end
+
+ it 'pre-processes correctly' do
expect(subject.to_html).to eq(expected)
end
end
end