new 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitmodules +3 -0
- data/.new +1 -1
- data/Gemfile.lock +25 -20
- data/Guardfile +6 -4
- data/README.md +9 -2
- data/doc/.git +1 -0
- data/doc/Gemfile.html +125 -0
- data/doc/Gemfile_lock.html +198 -0
- data/doc/Guardfile.html +134 -0
- data/doc/InterpolateSpec.html +116 -0
- data/doc/LICENSE_txt.html +132 -0
- data/doc/New/Cli.html +290 -0
- data/doc/New/Dsl.html +185 -0
- data/doc/New/Interpolate.html +238 -0
- data/doc/New/Project.html +171 -0
- data/doc/New/Task/CustomBarTask.html +154 -0
- data/doc/New/Task/FooTask.html +168 -0
- data/doc/New/Task/Gem.html +197 -0
- data/doc/New/Task/TaskSpec.html +168 -0
- data/doc/New/Task.html +380 -0
- data/doc/New/Template.html +234 -0
- data/doc/New/Version.html +277 -0
- data/doc/New.html +377 -0
- data/doc/Object.html +200 -0
- data/doc/README_md.html +292 -0
- data/doc/VersionSpec.html +116 -0
- data/doc/created.rid +47 -0
- data/doc/fonts/Lato-Light.ttf +0 -0
- data/doc/fonts/Lato-LightItalic.ttf +0 -0
- data/doc/fonts/Lato-Regular.ttf +0 -0
- data/doc/fonts/Lato-RegularItalic.ttf +0 -0
- data/doc/fonts/SourceCodePro-Bold.ttf +0 -0
- data/doc/fonts/SourceCodePro-Regular.ttf +0 -0
- data/doc/fonts.css +167 -0
- data/doc/images/add.png +0 -0
- data/doc/images/arrow_up.png +0 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +142 -0
- data/doc/js/darkfish.js +140 -0
- data/doc/js/jquery.js +18 -0
- data/doc/js/navigation.js +142 -0
- data/doc/js/search.js +109 -0
- data/doc/js/search_index.js +1 -0
- data/doc/js/searcher.js +228 -0
- data/doc/rdoc.css +580 -0
- data/doc/spec/fixtures/custom/templates/custom_bar_template/custom_bar_txt.html +110 -0
- data/doc/table_of_contents.html +324 -0
- data/doc/tasks/gem/README_md.html +150 -0
- data/doc/templates/js/Gemfile.html +147 -0
- data/doc/templates/js/Guardfile.html +117 -0
- data/doc/templates/js/lib/README_md.html +114 -0
- data/doc/templates/js/spec/spec_helper_js_coffee.html +110 -0
- data/doc/templates/js/spec/vendor/chai_js.html +3864 -0
- data/doc/templates/js/spec/vendor/sinon-chai_js.html +222 -0
- data/doc/templates/js/spec/vendor/sinon_js.html +4358 -0
- data/doc/templates/js/src/README_md.html +125 -0
- data/lib/new/task.rb +2 -4
- data/lib/new/template.rb +1 -1
- data/lib/new/version.rb +27 -19
- data/spec/fixtures/tasks/foo_task/Gemfile +5 -0
- data/spec/lib/new/version_spec.rb +10 -15
- data/spec/spec_helper.rb +22 -1
- data/tasks/gem/gem.rb +44 -8
- data/tasks/gem/gem_spec.rb +139 -0
- metadata +233 -3
@@ -0,0 +1,222 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>sinon-chai.js - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<link href="../../../../fonts.css" rel="stylesheet">
|
10
|
+
<link href="../../../../rdoc.css" rel="stylesheet">
|
11
|
+
|
12
|
+
<script type="text/javascript">
|
13
|
+
var rdoc_rel_prefix = "../../../../";
|
14
|
+
</script>
|
15
|
+
|
16
|
+
<script src="../../../../js/jquery.js"></script>
|
17
|
+
<script src="../../../../js/navigation.js"></script>
|
18
|
+
<script src="../../../../js/search_index.js"></script>
|
19
|
+
<script src="../../../../js/search.js"></script>
|
20
|
+
<script src="../../../../js/searcher.js"></script>
|
21
|
+
<script src="../../../../js/darkfish.js"></script>
|
22
|
+
|
23
|
+
|
24
|
+
<body id="top" role="document" class="file">
|
25
|
+
<nav role="navigation">
|
26
|
+
<div id="project-navigation">
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
28
|
+
<h2>
|
29
|
+
<a href="../../../../index.html" rel="home">Home</a>
|
30
|
+
</h2>
|
31
|
+
|
32
|
+
<div id="table-of-contents-navigation">
|
33
|
+
<a href="../../../../table_of_contents.html#pages">Pages</a>
|
34
|
+
<a href="../../../../table_of_contents.html#classes">Classes</a>
|
35
|
+
<a href="../../../../table_of_contents.html#methods">Methods</a>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
41
|
+
<div id="search-field-wrapper">
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
49
|
+
aria-busy="false" aria-expanded="false"
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
51
|
+
</form>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
</div>
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
<div id="project-metadata">
|
59
|
+
<div id="fileindex-section" class="nav-section">
|
60
|
+
<h3>Pages</h3>
|
61
|
+
|
62
|
+
<ul class="link-list">
|
63
|
+
|
64
|
+
<li><a href="../../../../Gemfile.html">Gemfile</a>
|
65
|
+
|
66
|
+
<li><a href="../../../../Gemfile_lock.html">Gemfile.lock</a>
|
67
|
+
|
68
|
+
<li><a href="../../../../Guardfile.html">Guardfile</a>
|
69
|
+
|
70
|
+
<li><a href="../../../../LICENSE_txt.html">LICENSE</a>
|
71
|
+
|
72
|
+
<li><a href="../../../../README_md.html">README</a>
|
73
|
+
|
74
|
+
<li><a href="../../../../spec/fixtures/custom/templates/custom_bar_template/custom_bar_txt.html">custom_bar</a>
|
75
|
+
|
76
|
+
<li><a href="../../../../tasks/gem/README_md.html">README</a>
|
77
|
+
|
78
|
+
<li><a href="../../../../templates/js/Gemfile.html">Gemfile</a>
|
79
|
+
|
80
|
+
<li><a href="../../../../templates/js/Guardfile.html">Guardfile</a>
|
81
|
+
|
82
|
+
<li><a href="../../../../templates/js/lib/README_md.html">README</a>
|
83
|
+
|
84
|
+
<li><a href="../../../../templates/js/spec/spec_helper_js_coffee.html">spec_helper.js.coffee</a>
|
85
|
+
|
86
|
+
<li><a href="../../../../templates/js/spec/vendor/chai_js.html">chai.js</a>
|
87
|
+
|
88
|
+
<li><a href="../../../../templates/js/spec/vendor/sinon-chai_js.html">sinon-chai.js</a>
|
89
|
+
|
90
|
+
<li><a href="../../../../templates/js/spec/vendor/sinon_js.html">sinon.js</a>
|
91
|
+
|
92
|
+
<li><a href="../../../../templates/js/src/README_md.html">README</a>
|
93
|
+
|
94
|
+
</ul>
|
95
|
+
</div>
|
96
|
+
|
97
|
+
</div>
|
98
|
+
</nav>
|
99
|
+
|
100
|
+
<main role="main" aria-label="Page templates/js/spec/vendor/sinon-chai.js">
|
101
|
+
|
102
|
+
<p>(function(sinonChai) {</p>
|
103
|
+
|
104
|
+
<pre class="ruby"><span class="ruby-string">"use strict"</span>;
|
105
|
+
|
106
|
+
<span class="ruby-regexp">//</span> <span class="ruby-constant">Module</span> <span class="ruby-identifier">systems</span> <span class="ruby-identifier">magic</span> <span class="ruby-identifier">dance</span>.
|
107
|
+
<span class="ruby-identifier">if</span> (<span class="ruby-identifier">typeof</span> <span class="ruby-identifier">require</span> <span class="ruby-operator">===</span> <span class="ruby-string">"function"</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">typeof</span> <span class="ruby-identifier">exports</span> <span class="ruby-operator">===</span> <span class="ruby-string">"object"</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">typeof</span> <span class="ruby-identifier">module</span> <span class="ruby-operator">===</span> <span class="ruby-string">"object"</span>) {
|
108
|
+
<span class="ruby-regexp">//</span> <span class="ruby-constant">NodeJS</span>
|
109
|
+
<span class="ruby-keyword">module</span>.<span class="ruby-identifier">exports</span> = <span class="ruby-identifier">sinonChai</span>;
|
110
|
+
} <span class="ruby-keyword">else</span> <span class="ruby-keyword">if</span> (<span class="ruby-identifier">typeof</span> <span class="ruby-identifier">define</span> <span class="ruby-operator">===</span> <span class="ruby-string">"function"</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">define</span>.<span class="ruby-identifier">amd</span>) {
|
111
|
+
<span class="ruby-regexp">//</span> <span class="ruby-constant">AMD</span>
|
112
|
+
<span class="ruby-identifier">define</span>(<span class="ruby-identifier">function</span>() {
|
113
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">sinonChai</span>;
|
114
|
+
});
|
115
|
+
} <span class="ruby-keyword">else</span> {
|
116
|
+
<span class="ruby-regexp">//</span> <span class="ruby-constant">Other</span> <span class="ruby-identifier">environment</span> (<span class="ruby-identifier">usually</span> <span class="ruby-operator"><</span><span class="ruby-identifier">script</span><span class="ruby-operator">></span> <span class="ruby-identifier">tag</span>)<span class="ruby-operator">:</span> <span class="ruby-identifier">plug</span> <span class="ruby-keyword">in</span> <span class="ruby-identifier">to</span> <span class="ruby-identifier">global</span> <span class="ruby-identifier">chai</span> <span class="ruby-identifier">instance</span> <span class="ruby-identifier">directly</span>.
|
117
|
+
<span class="ruby-identifier">chai</span>.<span class="ruby-identifier">use</span>(<span class="ruby-identifier">sinonChai</span>);
|
118
|
+
}
|
119
|
+
</pre>
|
120
|
+
|
121
|
+
<p>}(function sinonChai(chai, utils) {</p>
|
122
|
+
|
123
|
+
<pre>"use strict";
|
124
|
+
|
125
|
+
var slice = Array.prototype.slice;
|
126
|
+
|
127
|
+
function isSpy(putativeSpy) {
|
128
|
+
return typeof putativeSpy === "function" && typeof putativeSpy.getCall === "function" && typeof putativeSpy.calledWithExactly === "function";
|
129
|
+
}
|
130
|
+
|
131
|
+
function isCall(putativeCall) {
|
132
|
+
return putativeCall && isSpy(putativeCall.proxy);
|
133
|
+
}
|
134
|
+
|
135
|
+
function assertCanWorkWith(assertion) {
|
136
|
+
if (!isSpy(assertion._obj) && !isCall(assertion._obj)) {
|
137
|
+
throw new TypeError(utils.inspect(assertion._obj) + " is not a spy or a call to a spy!");
|
138
|
+
}
|
139
|
+
}
|
140
|
+
|
141
|
+
function getMessages(spy, action, nonNegatedSuffix, always, args) {
|
142
|
+
var verbPhrase = always ? "always have " : "have ";
|
143
|
+
nonNegatedSuffix = nonNegatedSuffix || "";
|
144
|
+
if (isSpy(spy.proxy)) {
|
145
|
+
spy = spy.proxy;
|
146
|
+
}
|
147
|
+
|
148
|
+
function printfArray(array) {
|
149
|
+
return spy.printf.apply(spy, array);
|
150
|
+
}
|
151
|
+
|
152
|
+
return {
|
153
|
+
affirmative: printfArray(["expected %n to " + verbPhrase + action + nonNegatedSuffix].concat(args)),
|
154
|
+
negative: printfArray(["expected %n to not " + verbPhrase + action].concat(args))
|
155
|
+
};
|
156
|
+
}
|
157
|
+
|
158
|
+
function sinonProperty(name, action, nonNegatedSuffix) {
|
159
|
+
utils.addProperty(chai.Assertion.prototype, name, function() {
|
160
|
+
assertCanWorkWith(this);
|
161
|
+
|
162
|
+
var messages = getMessages(this._obj, action, nonNegatedSuffix, false);
|
163
|
+
this.assert(this._obj[name], messages.affirmative, messages.negative);
|
164
|
+
});
|
165
|
+
}
|
166
|
+
|
167
|
+
function createSinonMethodHandler(sinonName, action, nonNegatedSuffix) {
|
168
|
+
return function() {
|
169
|
+
assertCanWorkWith(this);
|
170
|
+
|
171
|
+
var alwaysSinonMethod = "always" + sinonName[0].toUpperCase() + sinonName.substring(1);
|
172
|
+
var shouldBeAlways = utils.flag(this, "always") && typeof this._obj[alwaysSinonMethod] === "function";
|
173
|
+
var sinonMethod = shouldBeAlways ? alwaysSinonMethod : sinonName;
|
174
|
+
|
175
|
+
var messages = getMessages(this._obj, action, nonNegatedSuffix, shouldBeAlways, slice.call(arguments));
|
176
|
+
this.assert(this._obj[sinonMethod].apply(this._obj, arguments), messages.affirmative, messages.negative);
|
177
|
+
};
|
178
|
+
}
|
179
|
+
|
180
|
+
function sinonMethodAsProperty(name, action, nonNegatedSuffix) {
|
181
|
+
var handler = createSinonMethodHandler(name, action, nonNegatedSuffix);
|
182
|
+
utils.addProperty(chai.Assertion.prototype, name, handler);
|
183
|
+
}
|
184
|
+
|
185
|
+
function exceptionalSinonMethod(chaiName, sinonName, action, nonNegatedSuffix) {
|
186
|
+
var handler = createSinonMethodHandler(sinonName, action, nonNegatedSuffix);
|
187
|
+
utils.addMethod(chai.Assertion.prototype, chaiName, handler);
|
188
|
+
}
|
189
|
+
|
190
|
+
function sinonMethod(name, action, nonNegatedSuffix) {
|
191
|
+
exceptionalSinonMethod(name, name, action, nonNegatedSuffix);
|
192
|
+
}
|
193
|
+
|
194
|
+
utils.addProperty(chai.Assertion.prototype, "always", function() {
|
195
|
+
utils.flag(this, "always", true);
|
196
|
+
});
|
197
|
+
|
198
|
+
sinonProperty("called", "been called", " at least once, but it was never called");
|
199
|
+
sinonProperty("calledOnce", "been called exactly once", ", but it was called %c%C");
|
200
|
+
sinonProperty("calledTwice", "been called exactly twice", ", but it was called %c%C");
|
201
|
+
sinonProperty("calledThrice", "been called exactly thrice", ", but it was called %c%C");
|
202
|
+
sinonMethodAsProperty("calledWithNew", "been called with new");
|
203
|
+
sinonMethod("calledBefore", "been called before %1");
|
204
|
+
sinonMethod("calledAfter", "been called after %1");
|
205
|
+
sinonMethod("calledOn", "been called with %1 as this", ", but it was called with %t instead");
|
206
|
+
sinonMethod("calledWith", "been called with arguments %*", "%C");
|
207
|
+
sinonMethod("calledWithExactly", "been called with exact arguments %*", "%C");
|
208
|
+
sinonMethod("calledWithMatch", "been called with arguments matching %*", "%C");
|
209
|
+
sinonMethod("returned", "returned %1");
|
210
|
+
exceptionalSinonMethod("thrown", "threw", "thrown %1");</pre>
|
211
|
+
|
212
|
+
<p>}));</p>
|
213
|
+
</main>
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
<footer id="validator-badges" role="contentinfo">
|
218
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
219
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
|
220
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
221
|
+
</footer>
|
222
|
+
|