-
-
Save omega/73afe7b09b140bee3dd4 to your computer and use it in GitHub Desktop.
attr_is example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub _attr { | |
return 'No such element' unless my $e = shift->tx->res->dom->at(shift); | |
return $e->attr(shift); | |
} | |
sub attr_is { | |
my ($self, $selector, $attr, $value, $desc) = @_; | |
$desc ||= encode 'UTF-8', qq{exact match for attr "$attr" on selector "$selector"}; | |
return $self->_test('is', $self->_attr($selector, $attr), $value, $desc); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment