Skip to content

Commit

Permalink
Bumped version number to 3.3.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mattias Petter Johansson committed Mar 10, 2013
1 parent e7fabc8 commit 837deea
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
33 changes: 16 additions & 17 deletions lib/beautiful-lies.js
@@ -1,5 +1,5 @@
// Beautiful Lies
// version: 3.2.1
// version: 3.3.0
// author: Mattias Petter Johansson <mpj@mpj.me> http://mpj.me
// license: MIT
(function() {
Expand Down Expand Up @@ -73,19 +73,14 @@
assignHandler = function(host, function_name) {
var handler;
handler = function() {
var expectation, expectations_matching, expectations_matching_args, handler_callback, m, match, message, process_result_spec, process_single_callback_spec, s, _i, _j, _len, _len1, _ref, _ref1, _ref2;
expectation = null;
expectations_matching = filter_on_function(host.__expectations, function_name);
if (expectations_matching.length === 1 && !(expectations_matching[0]["arguments"] != null)) {
expectation = expectations_matching[0];
} else {
expectations_matching_args = filter_on_args(expectations_matching, arguments);
expectation = expectations_matching_args[0];
}
var expectation, handler_callback, m, match, matches_args, matches_name, message, process_result_spec, process_single_callback_spec, s, _i, _j, _len, _len1, _ref, _ref1, _ref2;
matches_name = filter_on_function(host.__expectations, function_name);
matches_args = filter_on_args(matches_name, arguments);
expectation = matches_args[0];
if (!expectation) {
message = ("" + function_name + " called with unexpected arguments. ") + "Actual: " + args_as_array(arguments).join(', ');
for (_i = 0, _len = expectations_matching.length; _i < _len; _i++) {
match = expectations_matching[_i];
for (_i = 0, _len = matches_name.length; _i < _len; _i++) {
match = matches_name[_i];
message += "Possible: " + args_as_array(match["arguments"]).join(', ');
}
throw new Error(message);
Expand Down Expand Up @@ -261,12 +256,16 @@
return _results;
};
matches_args_obj = function(exp) {
var exp_args, _ref;
exp_args = (_ref = exp["arguments"]) != null ? _ref : [];
if (!Array.isArray(exp_args)) {
throw new Error("arguments must be of type Array.");
if (exp.check) {
return exp.check.apply(null, actual_args_cleaned);
} else if (exp["arguments"] != null) {
if (!Array.isArray(exp["arguments"])) {
throw new Error("arguments must be of type Array.");
}
return arrays_equal(exp["arguments"], actual_args_cleaned);
} else {
return true;
}
return arrays_equal(exp_args, actual_args_cleaned);
};
actual_args_cleaned = remove_functions(args_obj);
return result();
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "beautiful-lies",
"version": "3.2.1",
"version": "3.3.0",
"url": "https://github.com/mpj/beautiful-lies",
"author": {
"name": "Mattias Petter Johansson",
Expand Down

0 comments on commit 837deea

Please sign in to comment.