diff options
| author | Igor Minar | 2010-11-02 16:23:12 -0700 |
|---|---|---|
| committer | Igor Minar | 2010-11-03 09:44:54 -0700 |
| commit | 0bd4a473a717d5ed9b9c07fbdbc5c336beeef4e5 (patch) | |
| tree | 991b68c0f04ac39a044f67cb36a14d60681724ca /src/scenario/dsl.js | |
| parent | dcf76e681624dca350d00a4a2e5f5d63deffcb17 (diff) | |
| download | angular.js-0bd4a473a717d5ed9b9c07fbdbc5c336beeef4e5.tar.bz2 | |
adding regular expressions support for binding() DSL
Diffstat (limited to 'src/scenario/dsl.js')
| -rw-r--r-- | src/scenario/dsl.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/scenario/dsl.js b/src/scenario/dsl.js index 7974f4ad..28e05724 100644 --- a/src/scenario/dsl.js +++ b/src/scenario/dsl.js @@ -156,7 +156,9 @@ angular.scenario.dsl('using', function() { */ angular.scenario.dsl('binding', function() { function contains(text, value) { - return text && text.indexOf(value) >= 0; + return value instanceof RegExp ? + value.test(text) : + text && text.indexOf(value) >= 0; } return function(name) { return this.addFutureAction("select binding '" + name + "'", function($window, $document, done) { |
