mirror of
https://github.com/hkalexling/Mango.git
synced 2025-08-03 11:25:29 -04:00
Update rename spec
This commit is contained in:
parent
911848ad11
commit
cf930418cb
@ -40,11 +40,6 @@ describe Rule do
|
|||||||
rule.render({"a" => "a", "b" => "b"}).should eq "a"
|
rule.render({"a" => "a", "b" => "b"}).should eq "a"
|
||||||
end
|
end
|
||||||
|
|
||||||
it "allows `|` outside of patterns" do
|
|
||||||
rule = Rule.new "hello|world"
|
|
||||||
rule.render({} of String => String).should eq "hello|world"
|
|
||||||
end
|
|
||||||
|
|
||||||
it "raises on escaped characters" do
|
it "raises on escaped characters" do
|
||||||
expect_raises Exception do
|
expect_raises Exception do
|
||||||
Rule.new "hello/world"
|
Rule.new "hello/world"
|
||||||
@ -69,8 +64,13 @@ describe Rule do
|
|||||||
rule.render({} of String => String).should eq "testing"
|
rule.render({} of String => String).should eq "testing"
|
||||||
end
|
end
|
||||||
|
|
||||||
it "escapes slash" do
|
it "escapes illegal characters" do
|
||||||
rule = Rule.new "{id}"
|
rule = Rule.new "{a}"
|
||||||
rule.render({"id" => "/hello/world"}).should eq "_hello_world"
|
rule.render({"a" => "/?<>:*|\"^"}).should eq "_________"
|
||||||
|
end
|
||||||
|
|
||||||
|
it "strips trailing spaces and dots" do
|
||||||
|
rule = Rule.new "hello. world. .."
|
||||||
|
rule.render({} of String => String).should eq "hello. world"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user