Skip to content

Commit

Permalink
Fixes #10 - there are differences in .source on the regexp object bet…
Browse files Browse the repository at this point in the history
…ween FF and Chrome, specifically FF will return the fully escaped string - this fix removes those differences
  • Loading branch information
PaulKinlan committed Feb 6, 2012
1 parent e410f6f commit b83c59a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/routeparsing.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ describe("route parsing", function() {


it("should parse / and add endmarker", function() { it("should parse / and add endmarker", function() {
r.get("/", 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() { it("should parse basic route and leave untouched", function() {
r.get("/category", 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() { it("should parse basic named identifier in position 0", function() {
r.get("/:category", function(){}); r.get("/:category", function(){});
expect(r.getRoutes()[0].regex.groups["category"]).toEqual(0); 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.