From 0bd4a473a717d5ed9b9c07fbdbc5c336beeef4e5 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Tue, 2 Nov 2010 16:23:12 -0700 Subject: adding regular expressions support for binding() DSL --- src/scenario/dsl.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/scenario') 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) { -- cgit v1.2.3