File: matcher.rb

package info (click to toggle)
ruby-eim-xml 0.0.4-3
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 192 kB
  • ctags: 171
  • sloc: ruby: 1,993; makefile: 7
file content (25 lines) | stat: -rw-r--r-- 461 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
require "eim_xml"
module EimXML::Matchers
	class HaveContent
		def initialize(expected)
			@expected = expected
		end

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

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

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

	def have(expected)
		HaveContent.new(expected)
	end
end