vendor/bundle/ruby/1.8/gems/Ruby-MemCache-0.0.1/tests/mctestcase.rb
def assert_nil_or_equal( value, object, msg="" )
		msg += "\n" unless msg.empty?
		msg += "Object <%p> expected to be nil or equal to <%p>" %
			[ object, value ]
		assert_block( msg ) {
			object.nil? || object.eql?( value )
		}
	rescue Test::Unit::AssertionFailedError => err
		cutframe = err.backtrace.reverse.find {|frame|
			/assert_nil_or_equal/ =~ frame
		}
		firstIdx = (err.backtrace.rindex( cutframe )||0) + 1
		Kernel::raise( err, err.message, err.backtrace[firstIdx..-1] )
	end
### Assert that the specified +object+ is either nil or equal (via #eql?) to
### the given +value+. This is to test return values from the cache, which
### should return either the original value or +nil+ if the value has
### expired from the cache.
Assert that the specified +object+ is either nil or equal (via #eql?) to
the given +value+. This is to test return values from the cache, which
should return either the original value or +nil+ if the value has
expired from the cache.
Assert that the specified + object + is either nil or equal ( via #eql? ) to the given + value + . This is to test return values from the cache which should return either the original value or + nil + if the value has expired from the cache .
def assert_nil_or_equal( value, object, msg="" )
		msg += "\n" unless msg.empty?
		msg += "Object <%p> expected to be nil or equal to <%p>" %
			[ object, value ]
		assert_block( msg ) {
			object.nil? || object.eql?( value )
		}
	rescue Test::Unit::AssertionFailedError => err
		cutframe = err.backtrace.reverse.find {|frame|
			/assert_nil_or_equal/ =~ frame
		}
		firstIdx = (err.backtrace.rindex( cutframe )||0) + 1
		Kernel::raise( err, err.message, err.backtrace[firstIdx..-1] )
	end
def assert_nil_or_equal ( value , object , msg = "" ) msg += "\n" unless msg . empty? msg += "Object <%p> expected to be nil or equal to <%p>" % [ object , value ] assert_block ( msg ) { object . nil? || object . eql? ( value ) } rescue Test :: Unit :: AssertionFailedError => err cutframe = err . backtrace . reverse . find { | frame | / assert_nil_or_equal / =~ frame } firstIdx = ( err . backtrace . rindex ( cutframe ) || 0 ) + 1 Kernel :: raise ( err , err . message , err . backtrace [ firstIdx .. - 1 ] ) end
Assert that the specified +object+ is either nil or equal (via #eql?)
Assert that the specified + object + is either nil or equal ( via #eql? )
value
object
msg