konacha-chai-matchers 0.0.14 → 0.0.15

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  module Konacha
2
2
  module Chai
3
3
  module Matchers
4
- VERSION = "0.0.14"
4
+ VERSION = "0.0.15"
5
5
  end
6
6
  end
7
7
  end
@@ -1,4 +1,4 @@
1
- // Generated by CoffeeScript 1.3.2
1
+ // Generated by CoffeeScript 1.3.3
2
2
  (function() {
3
3
 
4
4
  (function(chaiChanges) {
@@ -38,9 +38,6 @@
38
38
  }
39
39
  result = val();
40
40
  isPromise = (typeof result === 'object') && (typeof result.then === 'function');
41
- if (((typeof DS !== "undefined" && DS !== null ? DS.Model : void 0) != null) && result instanceof DS.Model) {
42
- isPromise = false;
43
- }
44
41
  if (isPromise) {
45
42
  done = options != null ? options.notify : void 0;
46
43
  if (done == null) {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Sinon.JS 1.5.2, 2013/01/15
2
+ * Sinon.JS 1.5.2, 2013/02/05
3
3
  *
4
4
  * @author Christian Johansen (christian@cjohansen.no)
5
5
  * @author Contributors: https://github.com/cjohansen/Sinon.JS/blob/master/AUTHORS
@@ -616,19 +616,19 @@ var sinon = (function (buster) {
616
616
  }(typeof sinon == "object" && sinon || null));
617
617
 
618
618
  /**
619
- * @depend ../sinon.js
620
- * @depend match.js
621
- */
619
+ * @depend ../sinon.js
620
+ * @depend match.js
621
+ */
622
622
  /*jslint eqeqeq: false, onevar: false, plusplus: false*/
623
623
  /*global module, require, sinon*/
624
624
  /**
625
- * Spy functions
626
- *
627
- * @author Christian Johansen (christian@cjohansen.no)
628
- * @license BSD
629
- *
630
- * Copyright (c) 2010-2011 Christian Johansen
631
- */
625
+ * Spy functions
626
+ *
627
+ * @author Christian Johansen (christian@cjohansen.no)
628
+ * @license BSD
629
+ *
630
+ * Copyright (c) 2010-2011 Christian Johansen
631
+ */
632
632
 
633
633
  (function (sinon) {
634
634
  var commonJSModule = typeof module == "object" && typeof require == "function";
@@ -651,7 +651,7 @@ var sinon = (function (buster) {
651
651
  }
652
652
 
653
653
  if (!object && !property) {
654
- return spy.create(function () {});
654
+ return spy.create(function () { });
655
655
  }
656
656
 
657
657
  var method = object[property];
@@ -724,7 +724,7 @@ var sinon = (function (buster) {
724
724
  var p;
725
725
  if (func.length) {
726
726
  eval("p = (function proxy(" + vars.substring(0, func.length * 2 - 1) +
727
- ") { return p.invoke(func, this, slice.call(arguments)); });");
727
+ ") { return p.invoke(func, this, slice.call(arguments)); });");
728
728
  }
729
729
  else {
730
730
  p = function proxy() {
@@ -765,7 +765,7 @@ var sinon = (function (buster) {
765
765
  var name;
766
766
 
767
767
  if (typeof func != "function") {
768
- func = function () {};
768
+ func = function () { };
769
769
  } else {
770
770
  name = sinon.functionName(func);
771
771
  }
@@ -822,8 +822,8 @@ var sinon = (function (buster) {
822
822
  }
823
823
 
824
824
  return spyCall.create(this, this.thisValues[i], this.args[i],
825
- this.returnValues[i], this.exceptions[i],
826
- this.callIds[i]);
825
+ this.returnValues[i], this.exceptions[i],
826
+ this.callIds[i]);
827
827
  },
828
828
 
829
829
  calledBefore: function calledBefore(spyFn) {
@@ -933,15 +933,26 @@ var sinon = (function (buster) {
933
933
  throw new Error(this.toString() + " cannot call arg since it was not yet invoked.");
934
934
  });
935
935
  spyApi.callArgWith = spyApi.callArg;
936
+ delegateToCalls(spyApi, "callArgOn", false, "callArgOnWith", function () {
937
+ throw new Error(this.toString() + " cannot call arg since it was not yet invoked.");
938
+ });
939
+ spyApi.callArgOnWith = spyApi.callArgOn;
936
940
  delegateToCalls(spyApi, "yield", false, "yield", function () {
937
941
  throw new Error(this.toString() + " cannot yield since it was not yet invoked.");
938
942
  });
939
943
  // "invokeCallback" is an alias for "yield" since "yield" is invalid in strict mode.
940
944
  spyApi.invokeCallback = spyApi.yield;
945
+ delegateToCalls(spyApi, "yieldOn", false, "yieldOn", function () {
946
+ throw new Error(this.toString() + " cannot yield since it was not yet invoked.");
947
+ });
941
948
  delegateToCalls(spyApi, "yieldTo", false, "yieldTo", function (property) {
942
949
  throw new Error(this.toString() + " cannot yield to '" + property +
943
950
  "' since it was not yet invoked.");
944
951
  });
952
+ delegateToCalls(spyApi, "yieldToOn", false, "yieldToOn", function (property) {
953
+ throw new Error(this.toString() + " cannot yield to '" + property +
954
+ "' since it was not yet invoked.");
955
+ });
945
956
 
946
957
  spyApi.formatters = {
947
958
  "c": function (spy) {
@@ -1032,14 +1043,14 @@ var sinon = (function (buster) {
1032
1043
  },
1033
1044
 
1034
1045
  calledWithMatch: function calledWithMatch() {
1035
- for (var i = 0, l = arguments.length; i < l; i += 1) {
1036
- var actual = this.args[i];
1037
- var expectation = arguments[i];
1038
- if (!sinon.match || !sinon.match(expectation).test(actual)) {
1039
- return false;
1040
- }
1041
- }
1042
- return true;
1046
+ for (var i = 0, l = arguments.length; i < l; i += 1) {
1047
+ var actual = this.args[i];
1048
+ var expectation = arguments[i];
1049
+ if (!sinon.match || !sinon.match(expectation).test(actual)) {
1050
+ return false;
1051
+ }
1052
+ }
1053
+ return true;
1043
1054
  },
1044
1055
 
1045
1056
  calledWithExactly: function calledWithExactly() {
@@ -1052,7 +1063,7 @@ var sinon = (function (buster) {
1052
1063
  },
1053
1064
 
1054
1065
  notCalledWithMatch: function notCalledWithMatch() {
1055
- return !this.calledWithMatch.apply(this, arguments);
1066
+ return !this.calledWithMatch.apply(this, arguments);
1056
1067
  },
1057
1068
 
1058
1069
  returned: function returned(value) {
@@ -1087,16 +1098,28 @@ var sinon = (function (buster) {
1087
1098
  this.args[pos]();
1088
1099
  },
1089
1100
 
1101
+ callArgOn: function (pos, thisValue) {
1102
+ this.args[pos].apply(thisValue);
1103
+ },
1104
+
1090
1105
  callArgWith: function (pos) {
1091
- var args = slice.call(arguments, 1);
1092
- this.args[pos].apply(null, args);
1106
+ this.callArgOnWith.apply(this, [pos, null].concat(slice.call(arguments, 1)));
1107
+ },
1108
+
1109
+ callArgOnWith: function (pos, thisValue) {
1110
+ var args = slice.call(arguments, 2);
1111
+ this.args[pos].apply(thisValue, args);
1093
1112
  },
1094
1113
 
1095
1114
  "yield": function () {
1115
+ this.yieldOn.apply(this, [null].concat(slice.call(arguments, 0)));
1116
+ },
1117
+
1118
+ yieldOn: function (thisValue) {
1096
1119
  var args = this.args;
1097
1120
  for (var i = 0, l = args.length; i < l; ++i) {
1098
1121
  if (typeof args[i] === "function") {
1099
- args[i].apply(null, slice.call(arguments));
1122
+ args[i].apply(thisValue, slice.call(arguments, 1));
1100
1123
  return;
1101
1124
  }
1102
1125
  }
@@ -1104,10 +1127,14 @@ var sinon = (function (buster) {
1104
1127
  },
1105
1128
 
1106
1129
  yieldTo: function (prop) {
1130
+ this.yieldToOn.apply(this, [prop, null].concat(slice.call(arguments, 1)));
1131
+ },
1132
+
1133
+ yieldToOn: function (prop, thisValue) {
1107
1134
  var args = this.args;
1108
1135
  for (var i = 0, l = args.length; i < l; ++i) {
1109
1136
  if (args[i] && typeof args[i][prop] === "function") {
1110
- args[i][prop].apply(null, slice.call(arguments, 1));
1137
+ args[i][prop].apply(thisValue, slice.call(arguments, 2));
1111
1138
  return;
1112
1139
  }
1113
1140
  }
@@ -1214,7 +1241,8 @@ var sinon = (function (buster) {
1214
1241
 
1215
1242
  function getChangingValue(stub, property) {
1216
1243
  var index = stub.callCount - 1;
1217
- var prop = index in stub[property] ? stub[property][index] : stub[property + "Last"];
1244
+ var values = stub[property];
1245
+ var prop = index in values ? values[index] : values[values.length - 1];
1218
1246
  stub[property + "Last"] = prop;
1219
1247
 
1220
1248
  return prop;
@@ -1271,8 +1299,6 @@ var sinon = (function (buster) {
1271
1299
  var nextTick = (function () {
1272
1300
  if (typeof process === "object" && typeof process.nextTick === "function") {
1273
1301
  return process.nextTick;
1274
- } else if (typeof msSetImmediate === "function") {
1275
- return msSetImmediate.bind(window);
1276
1302
  } else if (typeof setImmediate === "function") {
1277
1303
  return setImmediate;
1278
1304
  } else {
@@ -1290,8 +1316,6 @@ var sinon = (function (buster) {
1290
1316
  throw new TypeError(getCallbackError(stub, func, args));
1291
1317
  }
1292
1318
 
1293
- var index = stub.callCount - 1;
1294
-
1295
1319
  var callbackArguments = getChangingValue(stub, "callbackArguments");
1296
1320
  var callbackContext = getChangingValue(stub, "callbackContexts");
1297
1321
 
@@ -1910,7 +1934,8 @@ var sinon = (function (buster) {
1910
1934
  }
1911
1935
 
1912
1936
  var callStr = sinon.spyCall.toString.call({
1913
- proxy: this.method, args: args
1937
+ proxy: this.method || "anonymous mock expectation",
1938
+ args: args
1914
1939
  });
1915
1940
 
1916
1941
  var message = callStr.replace(", [...", "[, ...") + " " +
@@ -2264,6 +2289,8 @@ if (typeof sinon == "undefined") {
2264
2289
  if (firstException) {
2265
2290
  throw firstException;
2266
2291
  }
2292
+
2293
+ return this.now;
2267
2294
  },
2268
2295
 
2269
2296
  firstTimerInRange: function (from, to) {
@@ -2770,6 +2797,8 @@ sinon.xhr = { XMLHttpRequest: this.XMLHttpRequest };
2770
2797
 
2771
2798
  if (this.async) {
2772
2799
  this.readyStateChange(FakeXMLHttpRequest.HEADERS_RECEIVED);
2800
+ } else {
2801
+ this.readyState = FakeXMLHttpRequest.HEADERS_RECEIVED;
2773
2802
  }
2774
2803
  },
2775
2804
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: konacha-chai-matchers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-30 00:00:00.000000000 Z
12
+ date: 2013-02-05 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: A set of Chai.js libraries ready to use for Konacha
15
15
  email:
@@ -56,21 +56,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
56
56
  - - ! '>='
57
57
  - !ruby/object:Gem::Version
58
58
  version: '0'
59
- segments:
60
- - 0
61
- hash: 4374627379221921237
62
59
  required_rubygems_version: !ruby/object:Gem::Requirement
63
60
  none: false
64
61
  requirements:
65
62
  - - ! '>='
66
63
  - !ruby/object:Gem::Version
67
64
  version: '0'
68
- segments:
69
- - 0
70
- hash: 4374627379221921237
71
65
  requirements: []
72
66
  rubyforge_project: konacha-chai-matchers
73
- rubygems_version: 1.8.24
67
+ rubygems_version: 1.8.25
74
68
  signing_key:
75
69
  specification_version: 3
76
70
  summary: Chai.js plugins collection for Konacha