My favorites | Sign in
Project Home Downloads Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 115: assertEquals() output format misshapen
1 person starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  virtix
Closed:  May 2008


 
Project Member Reported by virtix, May 23, 2008
 <cfscript>
     try{
      assertEquals(1,2, "my message");
     }
     catch(any e){
      actual = e.getMessage();
     }
     debug(actual);
     expected = "my message::[2] NOT EQUAL TO [1]"; 
     assertEquals(expected, actual);
  </cfscript>

 
May 23, 2008
Project Member #1 virtix
Test should actually look like this:

<cffunction name="testThatAssertEqualsFailureMessageIsMessageActualExpected">
  <cfscript>
     try{
      assertEquals(1,2, "my message");
     }
     catch(any e){
      actual = e.getMessage();
     }
     expected = "my message::[1] NOT EQUAL TO [2]"; 
     debug(expected);
     debug(actual);
     assertEquals(expected, actual);
  </cfscript>
</cffunction>
May 23, 2008
Project Member #2 virtix
Resolution: assertEquals() calls failNotEquals() but the parameters were out of order
in that call and, of course, there was no test for the output format. So, the call to
failNotEquals() was changed from 

failNotEquals(arguments.message, expectedStringValue, actualStringValue );

TO

failNotEquals(expectedStringValue, actualStringValue, arguments.message);

//Notes, good little lesson!
Status: Fixed

Powered by Google Project Hosting