So the test was wrong :-)

This commit is contained in:
Roberto Alsina 2023-07-14 17:52:25 -03:00
parent de4e072c97
commit 6069d9f049
2 changed files with 137 additions and 151 deletions

View File

@ -36,7 +36,17 @@ describe "Shortcodes" do
input[result.errors[0].position, 3].should eq ">}}"
end
it "foo should accept mismatched brackets in qvals" do
it "should accept mismatched brackets inside data are ok" do
input = "foobar {{% sc %}} >}}blah {{% /sc %}} "
result = parse(input)
result.shortcodes.size.should eq 1
result.errors.size.should eq 0
result.shortcodes[0].whole.should eq "{{% sc %}} >}}blah {{% /sc %}}"
result.shortcodes[0].data.should eq " >}}blah "
result.shortcodes[0].args.size.should eq 0
end
it "should accept mismatched brackets in qvals" do
input = "foobar {{% sc \">}}blah\" %}} {{% /sc %}}"
result = parse(input)
result.shortcodes.size.should eq 1
@ -46,18 +56,6 @@ describe "Shortcodes" do
result.shortcodes[0].args[0].@value.should eq ">}}blah"
end
it "foo should accept mismatched brackets inside data are ok" do
input = "foobar {{% sc %}} >}}blah {{% /sc %}} "
result = parse(input)
result.shortcodes.size.should eq 1
result.errors.size.should eq 0
result.shortcodes[0].whole.should eq "{{% sc %}} >}}blah {{% /sc %}}"
result.shortcodes[0].data.should eq " >}}blah "
result.shortcodes[0].args.size.should eq 1
result.shortcodes[0].args[0].@value.should eq ">}}blah"
end
it "should consider spaces in shortcodes optional" do
input = "foobar {{% shortcode%}}blah"
result = parse(input)

File diff suppressed because it is too large Load Diff