Class: EimXML::Matchers::HaveContent

Inherits:
Object
  • Object
show all
Defined in:
lib/eim_xml/matcher.rb

Instance Method Summary collapse

Constructor Details

#initialize(expected) ⇒ HaveContent

Returns a new instance of HaveContent.



4
5
6
# File 'lib/eim_xml/matcher.rb', line 4

def initialize(expected)
	@expected = expected
end

Instance Method Details

#failure_messageObject



13
14
15
# File 'lib/eim_xml/matcher.rb', line 13

def failure_message
	"expected #{@target.inspect} must have #{@expected}, but not."
end

#matches?(target) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
11
# File 'lib/eim_xml/matcher.rb', line 8

def matches?(target)
	@target = target
	@target.has?(@expected)
end

#negative_failure_messageObject



17
18
19
# File 'lib/eim_xml/matcher.rb', line 17

def negative_failure_message
	"expected #{@target.inspect} must not have #{@expected}, but has."
end