spec/route_parser_spec.rb in sinatra-named-routes-0.1.1 vs spec/route_parser_spec.rb in sinatra-named-routes-0.1.2
- old
+ new
@@ -18,9 +18,15 @@
route = Sinatra::NamedRoutes::Route.new('/hello/*.*')
url = route.build ['cristian', 'json']
url.should eql '/hello/cristian.json'
end
+ it 'supports paths with hypens' do
+ route = Sinatra::NamedRoutes::Route.new('/mostly-uncontrollable-hypens')
+ url = route.build
+ url.should eql '/mostly-uncontrollable-hypens'
+ end
+
it 'throws exception if required splats are missing' do
expect do
route = Sinatra::NamedRoutes::Route.new('/hello/*.*')
url = route.build ['cristian']
end.to raise_exception ArgumentError
\ No newline at end of file