Skip to content

Instantly share code, notes, and snippets.

View cjohansen's full-sized avatar

Christian Johansen cjohansen

View GitHub Profile
@cjohansen
cjohansen / buster.js
Created July 5, 2012 06:37 — forked from tcorral/buster_closure_bug
Sample buster test case inside a closure
exports.Browser = {
tests: ["closure-bug-test.js"]
};
@cjohansen
cjohansen / gist:2638282
Created May 8, 2012 18:31 — forked from megoth/gist:2635085
Graphite graph - Testing .size with done(function () { ... });
define([
"src/graphite/graph",
"src/graphite/dictionary",
"src/graphite/query",
"src/graphite/utils",
"src/graphite/when"
], function (Graph, Dictionary, Query, Utils, When) {
buster.testCase("Graphite graph", {
...
"Function .size": function (done) {
RATIONALE =<<_END
The case for a maybe:
We all know true and false, right? Larry Wall once said that truth should be
considered evident; therefore anything in Perl is either true or false, along with
anything else it may be. Truth is just an aspect.
And we use it easily, with the if/else construct:
if something
do_something
tacet = {
create: (function () {
function F() {}
return function (proto) {
F.prototype = proto;
return new F();
};
}),
TestCase("CapabilitiesTest", {
setUp: function () {
this.sandbox = sinon.create(sinon.sandbox());
this.sandbox.useServer();
this.server = this.sandbox.server;
},
tearDown: function () {
this.sandbox.restore();
},
def summer_monthly_usage
@summer_monthly_usage ||= rates.summer_months_nbr.inject(0) { |sum, m| sum + monthly_usage[m - 1] }
end