Skip to content
Browse files

Merge pull request #22 from stevemoser/master

Added assertNotEquals
  • Loading branch information...
2 parents 7340126 + 29cfdf6 commit 43e2238c56890963da53a4eda1d5aa7201d0475d @alexvollmer alexvollmer committed
Showing with 10 additions and 0 deletions.
  1. +10 −0 assertions.js
View
10 assertions.js
@@ -70,6 +70,16 @@ function assertEquals(expected, received, message) {
}
/**
+ * Assert that the +received+ object does not matches the +expected+ object (using
+ * plain ol' !=). If it doesn't, this method throws an exception with either
+ * a default message, or the one given as the last (optional) argument
+ */
+function assertNotEquals(expected, received, message) {
+ var defMessage = "Expected not <" + expected + "> but received <" + received + ">";
+ assertTrue(expected != received, message ? message + ": " + defMessage : defMessage);
+}
+
+/**
* Asserts that the given expression is false and otherwise throws an
* exception with a default message, or the optional +message+ parameter
*/

0 comments on commit 43e2238

Please sign in to comment.
Something went wrong with that request. Please try again.