Module: EimXML::Assertions

Defined in:
lib/eim_xml/assertions.rb

Instance Method Summary collapse

Instance Method Details

#assert_has(expect, element, message = "") ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/eim_xml/assertions.rb', line 4

def assert_has(expect, element, message="")
	message << "\n" unless message.size==0
	message << "<#{element}> doesn't have\n<#{expect.inspect}>"
	assert_block(message) do
		element.has?(expect)
	end
rescue Test::Unit::AssertionFailedError=>e
	bt = e.backtrace.find_all do |b|
		b !~ /#{Regexp.escape(__FILE__)}/
	end
	raise Test::Unit::AssertionFailedError, e.message, bt
end