Class: Watirmark::Matcher
Constant Summary collapse
- @@matchers =
{}
Class Method Summary collapse
- .add_matcher(name, &block) ⇒ Object
- .exists?(name) ⇒ Boolean
- .matches?(element, expected, actual) ⇒ Boolean
Class Method Details
.add_matcher(name, &block) ⇒ Object
6 7 8 |
# File 'lib/watirmark/controller/matcher.rb', line 6 def add_matcher(name, &block) @@matchers[name] = block end |
.exists?(name) ⇒ Boolean
10 11 12 |
# File 'lib/watirmark/controller/matcher.rb', line 10 def exists?(name) @@matchers.has_key?(name) end |
.matches?(element, expected, actual) ⇒ Boolean
14 15 16 |
# File 'lib/watirmark/controller/matcher.rb', line 14 def matches?(element, expected, actual) instance_exec(element, actual, &@@matchers[expected]) end |