Class: Spec::Matchers::Include

Inherits:
Object
  • Object
show all
Defined in:
lib/spec/matchers/include.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(expected) ⇒ Include

Returns a new instance of Include.



6
7
8
# File 'lib/spec/matchers/include.rb', line 6

def initialize(expected)
  @expected = expected
end

Instance Method Details

#descriptionObject



23
24
25
# File 'lib/spec/matchers/include.rb', line 23

def description
  "include #{@expected.inspect}"
end

#failure_messageObject



15
16
17
# File 'lib/spec/matchers/include.rb', line 15

def failure_message
  _message
end

#matches?(actual) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
13
# File 'lib/spec/matchers/include.rb', line 10

def matches?(actual)
  @actual = actual
  actual.include?(@expected)
end

#negative_failure_messageObject



19
20
21
# File 'lib/spec/matchers/include.rb', line 19

def negative_failure_message
  _message("not ")
end