Skip to content


Subversion checkout URL

You can clone with
Download ZIP


contextMatchesOptions tests fail #124

merged 1 commit into from

6 participants


In version 0.7.1 most contextMatchesOptions tests fail.
This should fix it.


The bug this fixes breaks my app - have had to use 0.70. (I'm trying to use Sammy.before({except: ... )

Would definitely be a good one to fix.


+1 on this!



@quirkey quirkey merged commit edbbd3f into quirkey:master

This commit has broken path checks when using app.contextMatchesOptions(context, /some-reg-expression-path/) - it always returns true.

@rikkert rikkert referenced this pull request from a commit in rikkert/sammy
@rikkert rikkert Make pull request #124 actually work.
This fixes #140 where a regexp object as option was not recognized.
Adds _isRegExp() to do easy check for regexp objects.
Makes all Sammy.Application contextMatchesOptions tests pass and adds
test should match against undefined options.

Good catch, made it all work in pull request 141 for your issue #140.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 24, 2012
  1. @rikkert

    Fix contextMatchesOptions tests.

    rikkert committed
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/sammy.js
2  lib/sammy.js
@@ -1110,7 +1110,7 @@
contextMatchesOptions: function(context, match_options, positive) {
// empty options always match
var options = match_options;
- if (typeof options === 'undefined' || $.isPlainObject(options)) {
+ if (typeof options === 'undefined' || $.isEmptyObject(options)) {
return true;
if (typeof positive === 'undefined') {
Something went wrong with that request. Please try again.