Yahoo! UI Library

yuitest  3.0.0pr2

Yahoo! UI Library > yuitest > Assert.ObjectAssert
Search:
 
Filters

static Class Assert.ObjectAssert

The ObjectAssert object provides functions to test JavaScript objects for a variety of cases.

Methods

has

static void has ( propertyName , object , message )
Asserts that an object has a property with the given name.
Parameters:
propertyName <String> The name of the property to test.
object <Object> The object to search.
message <String> (Optional) The message to display if the assertion fails.
Returns: void

hasAll

static void hasAll ( refObject , object , message )
Asserts that an object has all properties of a reference object.
Parameters:
refObject <Object> The object whose properties should be on the object to test.
object <Object> The object to search.
message <String> (Optional) The message to display if the assertion fails.
Returns: void

owns

static void owns ( propertyName , object , message )
Asserts that a property with the given name exists on an object instance (not on its prototype).
Parameters:
propertyName <String> The name of the property to test.
object <Object> The object to search.
message <String> (Optional) The message to display if the assertion fails.
Returns: void

ownsAll

static void ownsAll ( refObject , object , message )
Asserts that all properties on a given object also exist on an object instance (not on its prototype).
Parameters:
refObject <Object> The object whose properties should be owned by the object to test.
object <Object> The object to search.
message <String> (Optional) The message to display if the assertion fails.
Returns: void


Copyright © 2008 Yahoo! Inc. All rights reserved.