Changeset 7631

Show
Ignore:
Timestamp:
03/17/07 20:36:54 (22 months ago)
Author:
alex
Message:

changing the names to assert* from is*. Refs #2550

Location:
dojo/trunk/tests
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • dojo/trunk/tests/runner.js

    r7628 r7631  
    430430// 
    431431 
    432 tests.isTrue = function(/*Object*/ condition){ 
     432tests.assertTrue = function(/*Object*/ condition){ 
    433433        // summary: 
    434434        //              is the passed item "truthy"? 
    435435        if(!eval(condition)){ 
    436                 throw tests._AssertFailure("isTrue('" + condition + "') failed"); 
    437         } 
    438 } 
    439  
    440 tests.isFalse = function(/*Object*/ condition){ 
     436                throw tests._AssertFailure("assertTrue('" + condition + "') failed"); 
     437        } 
     438} 
     439 
     440tests.assertFalse = function(/*Object*/ condition){ 
    441441        // summary: 
    442442        //              is the passed item "falsey"? 
    443443        if(eval(condition)){ 
    444                 throw tests._AssertFailure("isFalse('" + condition + "') failed"); 
    445         } 
    446 } 
    447  
    448 tests.isEq = function(/*Object*/ expected, /*Object*/ actual){ 
     444                throw tests._AssertFailure("assertFalse('" + condition + "') failed"); 
     445        } 
     446} 
     447 
     448tests.assertEqual = function(/*Object*/ expected, /*Object*/ actual){ 
    449449        // summary: 
    450450        //              are the passed expected and actual objects/values deeply 
     
    467467                return true; 
    468468        } 
    469         throw new tests._AssertFailure("isEq() failed: expected |"+expected+"| but got |"+actual+"|"); 
     469        throw new tests._AssertFailure("assertEqual() failed: expected |"+expected+"| but got |"+actual+"|"); 
    470470} 
    471471 
     
    474474        // FIXME: we're not handling circular refs. Do we care? 
    475475        for(var x=0; x<expected.length; x++){ 
    476                 if(!tests.isEq(expected[x], actual[x])){ return false; } 
     476                if(!tests.assertEqual(expected[x], actual[x])){ return false; } 
    477477        } 
    478478        return true; 
     
    481481tests._objPropEq = function(expected, actual){ 
    482482        for(var x in expected){ 
    483                 if(!tests.isEq(expected[x], actual[x])){ 
     483                if(!tests.assertEqual(expected[x], actual[x])){ 
    484484                        return false; 
    485485                } 
  • dojo/trunk/tests/_base.js

    r7628 r7631  
    1212                function sanityCheckHarness(t){ 
    1313                        // sanity checks 
    14                         t.isTrue(true); 
    15                         t.isFalse(false); 
    16                         t.isFalse(0); 
    17                         t.isFalse(null); 
     14                        t.assertTrue(true); 
     15                        t.assertFalse(false); 
     16                        t.assertFalse(0); 
     17                        t.assertFalse(null); 
    1818                        var tObj = { w00t: false, blarg: true }; 
    19                         t.isEq( 
     19                        t.assertEqual( 
    2020                                ["thinger", "blah", tObj],  
    2121                                ["thinger", "blah", tObj] 
    2222                        ); 
    23                         t.isEq(tObj, tObj); 
     23                        t.assertEqual(tObj, tObj); 
    2424                }, 
    2525                /* 
    2626                // uncomment to tests exception handling 
    27                 function sanityCheckIsTrue(t){ 
     27                function sanityCheckassertTrue(t){ 
    2828                        // should throw an error 
    29                         t.isTrue(false); 
     29                        t.assertTrue(false); 
    3030                }, 
    31                 function sanityCheckIsFalse(t){ 
     31                function sanityCheckassertFalse(t){ 
    3232                        // should throw an error 
    33                         t.isFalse(true); 
     33                        t.assertFalse(true); 
    3434                }, 
    35                 function sanityCheckIsEq(t){ 
     35                function sanityCheckassertEqual(t){ 
    3636                        // should throw an error 
    37                         t.isEq("foo", "bar"); 
     37                        t.assertEqual("foo", "bar"); 
    3838                }, 
    3939                */ 
     
    4545                        }, 
    4646                        runTest: function(t){ 
    47                                 t.isEq("blah", this.foo); 
     47                                t.assertEqual("blah", this.foo); 
    4848                        }, 
    4949                        tearDown: function(t){ 
     
    5757                [ 
    5858                        function dojoIsAvailable(t){ 
    59                                 t.isTrue(testGlobal["dojo"]); 
     59                                t.assertTrue(testGlobal["dojo"]); 
    6060                        } 
    6161                ] 
     
    7272                                        var d = new tests.Deferred(); 
    7373                                        setTimeout(d.getTestCallback(function(){ 
    74                                                 t.isTrue(true); 
    75                                                 t.isFalse(false); 
     74                                                t.assertTrue(true); 
     75                                                t.assertFalse(false); 
    7676                                        }), 50); 
    7777                                        return d;