Class: MotionSpec::Matcher::Include
- Defined in:
- lib/motion-spec/matcher/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.
5 6 7 |
# File 'lib/motion-spec/matcher/include.rb', line 5 def initialize(*values) @values = *values end |
Instance Method Details
#fail!(subject, negated) ⇒ Object
13 14 15 16 17 |
# File 'lib/motion-spec/matcher/include.rb', line 13 def fail!(subject, negated) raise FailedExpectation.new( FailMessageRenderer.(negated, subject, @values) ) end |
#matches?(subject) ⇒ Boolean
9 10 11 |
# File 'lib/motion-spec/matcher/include.rb', line 9 def matches?(subject) @values.all? { |v| subject.include?(v) } end |