All the following examples from spec/integration/hanami/router/generation_spec.rb are skipped.
I think these were most likely disabled when we first introduced the trie structure for 2.0, and then we did not reintroduce this behaviour afterwards.
I think this is useful to have. We should have a look to see whether we can achieve it again.
context "variable with optional format" do
let(:router) do
described_class.new do
get "/:var(.:format)", as: :a, to: -> {}
end
end
it "generates relative and absolute URLs" do
runner.run!([
[:a, "/test.html", {var: "test", format: "html"}],
[:a, "/test", {var: "test"}]
])
end
end
context "variable with optional variable" do
let(:router) do
described_class.new do
get "/:var1(/:var2)", as: :a, to: -> {}
end
end
xit "generates relative and absolute URLs" do
runner.run!([
[:a, "/foo/bar", {var1: "foo", var2: "bar"}],
[:a, "/foo", {var1: "foo"}]
])
end
end
context "variable with optional variable and format" do
let(:router) do
described_class.new do
get "/:var1(/:var2.:format)", as: :a, to: -> {}
end
end
xit "generates relative and absolute URLs" do
runner.run!([
[:a, "/test/test2.html", {var1: "test", var2: "test2", format: "html"}]
])
end
end
context "variable with optional nested variables" do
let(:router) do
described_class.new do
get "/:var1(/:var2(/:var3))", as: :a, to: -> {}
end
end
xit "generates relative and absolute URLs" do
runner.run!([
[:a, "/var/fooz/baz", {var1: "var", var2: "fooz", var3: "baz"}],
[:a, "/var/fooz", {var1: "var", var2: "fooz"}],
[:a, "/var", {var1: "var"}]
])
end
end
All the following examples from
spec/integration/hanami/router/generation_spec.rbare skipped.I think these were most likely disabled when we first introduced the trie structure for 2.0, and then we did not reintroduce this behaviour afterwards.
I think this is useful to have. We should have a look to see whether we can achieve it again.