Skip to content
Browse files

Add more flexible message for new matcher(s)

  • Loading branch information...
1 parent 701c957 commit 77fc09799913d4aa85b0b6ec56e4cbdc373128bb James Somers & Steve Ellis committed Sep 24, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 vendor/assets/javascripts/cactus.js
View
6 vendor/assets/javascripts/cactus.js
@@ -90,13 +90,13 @@ Cactus = (function() {
return str;
}
- function compare(computed, expected, comparator) {
+ function compare(computed, expected, comparator, operation) {
var result = true, status, message;
if ($(tag_name).is("*")) {
$.each(computed, function(index, style) {
status = comparator(style, expected);
- message = "Expected " + selector(index) + " " + property + " to equal " + expected + ". Got " + style + ".";
+ message = "Expected " + selector(index) + " " + property + " to " + (operation ? operation : "equal") + " " + expected + ". Got " + style + ".";
result = result && status;
@@ -105,7 +105,7 @@ Cactus = (function() {
});
} else {
status = "skip";
- message = "Expected " + selector() + " " + property + " to equal " + expected + ".";
+ message = "Expected " + selector() + " " + property + " to " + (operation ? operation : "equal") + " " + expected + ".";
result = status;

0 comments on commit 77fc097

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