Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Added assertNotEquals #22

Merged
merged 1 commit into from

2 participants

@stevemoser

Not much else to say...

@alexvollmer alexvollmer merged commit 43e2238 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 10, 2012
  1. @stevemoser

    added assertNotEquals

    stevemoser authored
This page is out of date. Refresh to see the latest.
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
*/
Something went wrong with that request. Please try again.