Skip to content
This repository
Browse code

Just coffee, no longer have to compile to javascript

  • Loading branch information...
commit bdcb9f5648272c22d4ab7f21d497e11d3c91084c 1 parent 3299977
Quang Van authored January 13, 2012
69  cakes.js
... ...
@@ -1,69 +0,0 @@
1  
-(function() {
2  
-  var colors, depict, func, name, _ref,
3  
-    __slice = Array.prototype.slice;
4  
-
5  
-  colors = require('colors');
6  
-
7  
-  exports.Feature = function() {
8  
-    var callback, feature, message, part, story, _i, _j, _len;
9  
-    feature = arguments[0], story = 3 <= arguments.length ? __slice.call(arguments, 1, _i = arguments.length - 1) : (_i = 1, []), callback = arguments[_i++];
10  
-    message = ("Feature: " + feature + " \n\n").green.underline;
11  
-    for (_j = 0, _len = story.length; _j < _len; _j++) {
12  
-      part = story[_j];
13  
-      message += '\t' + part + '\n';
14  
-    }
15  
-    describe(message, callback);
16  
-  };
17  
-
18  
-  depict = function(label, args) {
19  
-    if (args.length === 1) {
20  
-      args[1] = args[0];
21  
-      label = '';
22  
-    }
23  
-    return describe(label.replace('%s', args[0]), args[1]);
24  
-  };
25  
-
26  
-  /*
27  
-  exports.Background = (action, callback)->
28  
-  	depict action.magenta, arguments
29  
-  */
30  
-
31  
-  exports.Scenario = function() {
32  
-    return depict("\n    Scenario: %s".green, arguments);
33  
-  };
34  
-
35  
-  exports.Given = function() {
36  
-    return depict("Given:".yellow + " %s", arguments);
37  
-  };
38  
-
39  
-  exports.When = function() {
40  
-    return depict(" When:".yellow + " %s", arguments);
41  
-  };
42  
-
43  
-  exports.And = function() {
44  
-    return depict("  and".grey + "  %s", arguments);
45  
-  };
46  
-
47  
-  exports.Then = function() {
48  
-    return depict(" Then:".yellow + " %s", arguments);
49  
-  };
50  
-
51  
-  exports.But = function() {
52  
-    return depict("  But".yellow + "  %s", arguments);
53  
-  };
54  
-
55  
-  exports.Spec = function() {
56  
-    return depict('%s'.blue, arguments);
57  
-  };
58  
-
59  
-  exports.step = function(title, fn) {
60  
-    return it(title, fn);
61  
-  };
62  
-
63  
-  _ref = module.exports;
64  
-  for (name in _ref) {
65  
-    func = _ref[name];
66  
-    global[name] = func;
67  
-  }
68  
-
69  
-}).call(this);
3  compiler
... ...
@@ -1,3 +0,0 @@
1  
-#!/bin/bash
2  
-
3  
-coffee --watch --compile cakes.coffee
2  index.js
... ...
@@ -0,0 +1,2 @@
  1
+require('coffee-script');
  2
+module.exports = require('./cakes.coffee');
2  package.json
@@ -8,5 +8,5 @@
8 8
   ,	"devDependencies" : {	"coffee-script" : "*"
9 9
                     }
10 10
   , "keywords" : ["mocha", "bdd", "stories", "cucumber", "test"]
11  
-  , "main" : "cakes"
  11
+  , "main" : "./index.js"
12 12
 }

0 notes on commit bdcb9f5

Please sign in to comment.
Something went wrong with that request. Please try again.