vendor/bundle/ruby/1.8/gems/Ruby-MemCache-0.0.1/tests/mctestcase.rb
def assert_has_ivar( sym, object )
		sym = "@#{sym}" unless /^@/ =~ sym.to_s
		msg = "Object <%s> expected to have an instance variable <%s>" %
			[ object.inspect, sym ]
		assert_block( msg ) {
			object.instance_variables.include?( sym.to_s )
		}
	rescue Test::Unit::AssertionFailedError => err
		cutframe = err.backtrace.reverse.find {|frame|
			/assert_has_ivar/ =~ frame
		}
		firstIdx = (err.backtrace.rindex( cutframe )||0) + 1
		Kernel::raise( err, err.message, err.backtrace[firstIdx..-1] )
	end
### Assert that the specified +object+ has an instance variable which
### matches the specified +sym+. The '@' at the beginning of the +sym+
### will be prepended if not present.
Assert that the specified +object+ has an instance variable which
matches the specified +sym+. The '@' at the beginning of the +sym+
will be prepended if not present.
Assert that the specified + object + has an instance variable which matches the specified + sym + . The ' @ ' at the beginning of the + sym + will be prepended if not present .
def assert_has_ivar( sym, object )
		sym = "@#{sym}" unless /^@/ =~ sym.to_s
		msg = "Object <%s> expected to have an instance variable <%s>" %
			[ object.inspect, sym ]
		assert_block( msg ) {
			object.instance_variables.include?( sym.to_s )
		}
	rescue Test::Unit::AssertionFailedError => err
		cutframe = err.backtrace.reverse.find {|frame|
			/assert_has_ivar/ =~ frame
		}
		firstIdx = (err.backtrace.rindex( cutframe )||0) + 1
		Kernel::raise( err, err.message, err.backtrace[firstIdx..-1] )
	end
def assert_has_ivar ( sym , object ) sym = "@#{sym}" unless / ^@ / =~ sym . to_s msg = "Object <%s> expected to have an instance variable <%s>" % [ object . inspect , sym ] assert_block ( msg ) { object . instance_variables . include? ( sym . to_s ) } rescue Test :: Unit :: AssertionFailedError => err cutframe = err . backtrace . reverse . find { | frame | / assert_has_ivar / =~ frame } firstIdx = ( err . backtrace . rindex ( cutframe ) || 0 ) + 1 Kernel :: raise ( err , err . message , err . backtrace [ firstIdx .. - 1 ] ) end
Assert that the specified +object+ has an instance variable which
matches the specified +sym+.
Assert that the specified + object + has an instance variable which matches the specified + sym + .
sym
object