Class: RSpec::PathMatchers::Options::Content
- Inherits:
-
Base
- Object
- Base
- RSpec::PathMatchers::Options::Content
show all
- Defined in:
- lib/rspec/path_matchers/options/content.rb
Overview
Class Method Summary
collapse
Methods inherited from Base
description, match, validate_expected
Class Method Details
.fetch_actual(path, _failures) ⇒ Object
11
|
# File 'lib/rspec/path_matchers/options/content.rb', line 11
def self.fetch_actual(path, _failures) = File.read(path)
|
.key ⇒ Object
10
|
# File 'lib/rspec/path_matchers/options/content.rb', line 10
def self.key = :content
|
.literal_failure_message(actual, expected) ⇒ Object
20
21
22
23
24
25
26
|
# File 'lib/rspec/path_matchers/options/content.rb', line 20
def self.literal_failure_message(actual, expected)
if expected.is_a?(Regexp)
"expected content to match #{expected.inspect}, but got #{actual.inspect}"
else
super
end
end
|
.literal_match?(actual, expected) ⇒ Boolean
14
15
16
17
18
|
# File 'lib/rspec/path_matchers/options/content.rb', line 14
def self.literal_match?(actual, expected)
return expected.match?(actual) if expected.is_a?(Regexp)
super
end
|
.valid_expected_types ⇒ Object
12
|
# File 'lib/rspec/path_matchers/options/content.rb', line 12
def self.valid_expected_types = [String, Regexp]
|