Class: BaconExpect::Matcher::Include
- Inherits:
-
Object
- Object
- BaconExpect::Matcher::Include
- Defined in:
- lib/bacon-expect/matchers/include.rb
Instance Method Summary collapse
- #fail!(subject, negated) ⇒ Object
-
#initialize(*values) ⇒ Include
constructor
A new instance of Include.
- #matches?(subject) ⇒ Boolean
Constructor Details
#initialize(*values) ⇒ Include
Returns a new instance of Include.
3 4 5 |
# File 'lib/bacon-expect/matchers/include.rb', line 3 def initialize(*values) @values = *values end |
Instance Method Details
#fail!(subject, negated) ⇒ Object
11 12 13 |
# File 'lib/bacon-expect/matchers/include.rb', line 11 def fail!(subject, negated) raise FailedExpectation.new(FailMessageRenderer.(negated, subject, @values)) end |
#matches?(subject) ⇒ Boolean
7 8 9 |
# File 'lib/bacon-expect/matchers/include.rb', line 7 def matches?(subject) @values.all?{|v| subject.include?(v)} end |