new 0.0.0 → 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- metadata +7 -66
- data/.gitignore +0 -7
- data/.rspec +0 -2
- data/Gemfile +0 -16
- data/Gemfile.lock +0 -79
- data/Guardfile +0 -14
- data/LICENSE.txt +0 -22
- data/README.md +0 -121
- data/bin/new +0 -6
- data/lib/new/cli.rb +0 -94
- data/lib/new/core.rb +0 -6
- data/lib/new/dsl.rb +0 -42
- data/lib/new/interpolate.rb +0 -100
- data/lib/new/project.rb +0 -34
- data/lib/new/task.rb +0 -41
- data/lib/new/template.rb +0 -64
- data/lib/new/version.rb +0 -41
- data/lib/new.rb +0 -72
- data/spec/fixtures/custom/tasks/custom_bar_task/custom_bar_task.rb +0 -3
- data/spec/fixtures/custom/templates/custom_bar_template/custom_bar.txt +0 -0
- data/spec/fixtures/tasks/custom_bar_task/custom_bar_task.rb +0 -1
- data/spec/fixtures/tasks/foo_task/foo_task.rb +0 -7
- data/spec/fixtures/templates/foo_template/[FOO.BAR].txt.erb +0 -1
- data/spec/fixtures/templates/foo_template/nested_[FOO.BAR]/foo.txt.erb +0 -1
- data/spec/lib/new/cli_spec.rb +0 -104
- data/spec/lib/new/interpolate_spec.rb +0 -41
- data/spec/lib/new/project_spec.rb +0 -30
- data/spec/lib/new/task_spec.rb +0 -39
- data/spec/lib/new/template_spec.rb +0 -59
- data/spec/lib/new/version_spec.rb +0 -28
- data/spec/lib/new_spec.rb +0 -19
- data/spec/spec_helper.rb +0 -26
- data/tasks/gem/README.md +0 -36
- data/tasks/gem/gem.rb +0 -118
- data/templates/js/Gemfile +0 -30
- data/templates/js/Guardfile +0 -7
- data/templates/js/LICENSE-MIT.erb +0 -22
- data/templates/js/README.md.erb +0 -61
- data/templates/js/demo/index.html.erb +0 -7
- data/templates/js/lib/README.md +0 -2
- data/templates/js/spec/[PROJECT_NAME].spec.js.coffee.erb +0 -1
- data/templates/js/spec/index.html.erb +0 -29
- data/templates/js/spec/spec_helper.js.coffee +0 -0
- data/templates/js/spec/vendor/chai.js +0 -3765
- data/templates/js/spec/vendor/sinon-chai.js +0 -106
- data/templates/js/spec/vendor/sinon.js +0 -4246
- data/templates/js/src/README.md +0 -3
- data/templates/js/src/[PROJECT_NAME].js.coffee.erb +0 -10
- data/templates/js/testem.yml +0 -12
@@ -1,106 +0,0 @@
|
|
1
|
-
(function(sinonChai) {
|
2
|
-
"use strict";
|
3
|
-
|
4
|
-
// Module systems magic dance.
|
5
|
-
if (typeof require === "function" && typeof exports === "object" && typeof module === "object") {
|
6
|
-
// NodeJS
|
7
|
-
module.exports = sinonChai;
|
8
|
-
} else if (typeof define === "function" && define.amd) {
|
9
|
-
// AMD
|
10
|
-
define(function() {
|
11
|
-
return sinonChai;
|
12
|
-
});
|
13
|
-
} else {
|
14
|
-
// Other environment (usually <script> tag): plug in to global chai instance directly.
|
15
|
-
chai.use(sinonChai);
|
16
|
-
}
|
17
|
-
}(function sinonChai(chai, utils) {
|
18
|
-
"use strict";
|
19
|
-
|
20
|
-
var slice = Array.prototype.slice;
|
21
|
-
|
22
|
-
function isSpy(putativeSpy) {
|
23
|
-
return typeof putativeSpy === "function" && typeof putativeSpy.getCall === "function" && typeof putativeSpy.calledWithExactly === "function";
|
24
|
-
}
|
25
|
-
|
26
|
-
function isCall(putativeCall) {
|
27
|
-
return putativeCall && isSpy(putativeCall.proxy);
|
28
|
-
}
|
29
|
-
|
30
|
-
function assertCanWorkWith(assertion) {
|
31
|
-
if (!isSpy(assertion._obj) && !isCall(assertion._obj)) {
|
32
|
-
throw new TypeError(utils.inspect(assertion._obj) + " is not a spy or a call to a spy!");
|
33
|
-
}
|
34
|
-
}
|
35
|
-
|
36
|
-
function getMessages(spy, action, nonNegatedSuffix, always, args) {
|
37
|
-
var verbPhrase = always ? "always have " : "have ";
|
38
|
-
nonNegatedSuffix = nonNegatedSuffix || "";
|
39
|
-
if (isSpy(spy.proxy)) {
|
40
|
-
spy = spy.proxy;
|
41
|
-
}
|
42
|
-
|
43
|
-
function printfArray(array) {
|
44
|
-
return spy.printf.apply(spy, array);
|
45
|
-
}
|
46
|
-
|
47
|
-
return {
|
48
|
-
affirmative: printfArray(["expected %n to " + verbPhrase + action + nonNegatedSuffix].concat(args)),
|
49
|
-
negative: printfArray(["expected %n to not " + verbPhrase + action].concat(args))
|
50
|
-
};
|
51
|
-
}
|
52
|
-
|
53
|
-
function sinonProperty(name, action, nonNegatedSuffix) {
|
54
|
-
utils.addProperty(chai.Assertion.prototype, name, function() {
|
55
|
-
assertCanWorkWith(this);
|
56
|
-
|
57
|
-
var messages = getMessages(this._obj, action, nonNegatedSuffix, false);
|
58
|
-
this.assert(this._obj[name], messages.affirmative, messages.negative);
|
59
|
-
});
|
60
|
-
}
|
61
|
-
|
62
|
-
function createSinonMethodHandler(sinonName, action, nonNegatedSuffix) {
|
63
|
-
return function() {
|
64
|
-
assertCanWorkWith(this);
|
65
|
-
|
66
|
-
var alwaysSinonMethod = "always" + sinonName[0].toUpperCase() + sinonName.substring(1);
|
67
|
-
var shouldBeAlways = utils.flag(this, "always") && typeof this._obj[alwaysSinonMethod] === "function";
|
68
|
-
var sinonMethod = shouldBeAlways ? alwaysSinonMethod : sinonName;
|
69
|
-
|
70
|
-
var messages = getMessages(this._obj, action, nonNegatedSuffix, shouldBeAlways, slice.call(arguments));
|
71
|
-
this.assert(this._obj[sinonMethod].apply(this._obj, arguments), messages.affirmative, messages.negative);
|
72
|
-
};
|
73
|
-
}
|
74
|
-
|
75
|
-
function sinonMethodAsProperty(name, action, nonNegatedSuffix) {
|
76
|
-
var handler = createSinonMethodHandler(name, action, nonNegatedSuffix);
|
77
|
-
utils.addProperty(chai.Assertion.prototype, name, handler);
|
78
|
-
}
|
79
|
-
|
80
|
-
function exceptionalSinonMethod(chaiName, sinonName, action, nonNegatedSuffix) {
|
81
|
-
var handler = createSinonMethodHandler(sinonName, action, nonNegatedSuffix);
|
82
|
-
utils.addMethod(chai.Assertion.prototype, chaiName, handler);
|
83
|
-
}
|
84
|
-
|
85
|
-
function sinonMethod(name, action, nonNegatedSuffix) {
|
86
|
-
exceptionalSinonMethod(name, name, action, nonNegatedSuffix);
|
87
|
-
}
|
88
|
-
|
89
|
-
utils.addProperty(chai.Assertion.prototype, "always", function() {
|
90
|
-
utils.flag(this, "always", true);
|
91
|
-
});
|
92
|
-
|
93
|
-
sinonProperty("called", "been called", " at least once, but it was never called");
|
94
|
-
sinonProperty("calledOnce", "been called exactly once", ", but it was called %c%C");
|
95
|
-
sinonProperty("calledTwice", "been called exactly twice", ", but it was called %c%C");
|
96
|
-
sinonProperty("calledThrice", "been called exactly thrice", ", but it was called %c%C");
|
97
|
-
sinonMethodAsProperty("calledWithNew", "been called with new");
|
98
|
-
sinonMethod("calledBefore", "been called before %1");
|
99
|
-
sinonMethod("calledAfter", "been called after %1");
|
100
|
-
sinonMethod("calledOn", "been called with %1 as this", ", but it was called with %t instead");
|
101
|
-
sinonMethod("calledWith", "been called with arguments %*", "%C");
|
102
|
-
sinonMethod("calledWithExactly", "been called with exact arguments %*", "%C");
|
103
|
-
sinonMethod("calledWithMatch", "been called with arguments matching %*", "%C");
|
104
|
-
sinonMethod("returned", "returned %1");
|
105
|
-
exceptionalSinonMethod("thrown", "threw", "thrown %1");
|
106
|
-
}));
|