Permalink
Browse files

Fixes #10 - there are differences in .source on the regexp object bet…

…ween FF and Chrome, specifically FF will return the fully escaped string - this fix removes those differences
  • Loading branch information...
1 parent e410f6f commit b83c59a385dd52df88dbec84bd75b376ab2af13e Paul Kinlan committed Feb 6, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 tests/routeparsing.js
@@ -6,17 +6,17 @@ describe("route parsing", function() {
it("should parse / and add endmarker", function() {
r.get("/", function() { });
- expect(r.getRoutes()[0].regex.regexp.source).toEqual("/$");
+ expect(r.getRoutes()[0].regex.regexp).toEqual(/\//);
});
it("should parse basic route and leave untouched", function() {
r.get("/category", function() { });
- expect(r.getRoutes()[0].regex.regexp.source).toEqual("/category$");
+ expect(r.getRoutes()[0].regex.regexp).toEqual(/\/category$/);
});
it("should parse basic named identifier in position 0", function() {
r.get("/:category", function(){});
expect(r.getRoutes()[0].regex.groups["category"]).toEqual(0);
- expect(r.getRoutes()[0].regex.regexp.source).toEqual("/([^/.\\\\]+)$");
+ expect(r.getRoutes()[0].regex.regexp).toEqual(/\/([^\/.\\\\]+)$/);
});
});

0 comments on commit b83c59a

Please sign in to comment.