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.
39 40 41 42 43 |
# File 'lib/playwright/test.rb', line 39 def initialize(expectation_method, *args, **kwargs) @method = expectation_method @args = args @kwargs = kwargs end |
Instance Method Details
#does_not_match?(actual) ⇒ Boolean
53 54 55 56 57 58 59 |
# File 'lib/playwright/test.rb', line 53 def does_not_match?(actual) Expect.new.call(actual, true).send(@method, *@args, **@kwargs) true rescue AssertionError => e @failure_message = e. false end |
#failure_message ⇒ Object
61 62 63 |
# File 'lib/playwright/test.rb', line 61 def @failure_message end |
#failure_message_when_negated ⇒ Object
65 66 67 |
# File 'lib/playwright/test.rb', line 65 def @failure_message end |
#matches?(actual) ⇒ Boolean
45 46 47 48 49 50 51 |
# File 'lib/playwright/test.rb', line 45 def matches?(actual) Expect.new.call(actual, false).send(@method, *@args, **@kwargs) true rescue AssertionError => e @failure_message = e. false end |