Class: Playwright::Test::Matchers::PlaywrightMatcher
- Inherits:
-
Object
- Object
- Playwright::Test::Matchers::PlaywrightMatcher
- Defined in:
- lib/playwright/test.rb
Instance Method Summary collapse
- #does_not_match?(actual) ⇒ Boolean
- #failure_message ⇒ Object
- #failure_message_when_negated ⇒ Object
-
#initialize(expectation_method, *args, **kwargs) ⇒ PlaywrightMatcher
constructor
A new instance of PlaywrightMatcher.
- #matches?(actual) ⇒ Boolean
Constructor Details
#initialize(expectation_method, *args, **kwargs) ⇒ PlaywrightMatcher
Returns a new instance of PlaywrightMatcher.
26 27 28 29 30 |
# File 'lib/playwright/test.rb', line 26 def initialize(expectation_method, *args, **kwargs) @method = expectation_method @args = args @kwargs = kwargs end |
Instance Method Details
#does_not_match?(actual) ⇒ Boolean
40 41 42 43 44 45 46 |
# File 'lib/playwright/test.rb', line 40 def does_not_match?(actual) assertions_for(actual, true).send(@method, *@args, **@kwargs) true rescue AssertionError => e @failure_message = e. false end |
#failure_message ⇒ Object
48 49 50 |
# File 'lib/playwright/test.rb', line 48 def @failure_message end |
#failure_message_when_negated ⇒ Object
52 53 54 |
# File 'lib/playwright/test.rb', line 52 def @failure_message end |
#matches?(actual) ⇒ Boolean
32 33 34 35 36 37 38 |
# File 'lib/playwright/test.rb', line 32 def matches?(actual) assertions_for(actual, false).send(@method, *@args, **@kwargs) true rescue AssertionError => e @failure_message = e. false end |