Procházet zdrojové kódy

added test descriptions and instructions to the readme

tags/0.4.0
Ben Cherry před 15 roky
rodič
revize
88ec36afe5
1 změnil soubory, kde provedl 24 přidání a 0 odebrání
  1. +24
    -0
      README.md

+ 24
- 0
README.md Zobrazit soubor

@@ -344,8 +344,32 @@ directory.
Run `rake commonjs` to get a CommonJS compatible plugin file in the Run `rake commonjs` to get a CommonJS compatible plugin file in the
`mustache-commonjs/` directory which you can also use with [Node.js][]. `mustache-commonjs/` directory which you can also use with [Node.js][].


## Testing

To run the mustache.js test suite, run `rake spec`. All specs will be run first with JavaScriptCore (using `jsc`)
and again with Rhino, using `java org.mozilla.javascript.tools.shell.Main`. To install Rhino on OSX, follow [these instructions](Rhino Install).

### Adding Tests

Tests are located in the `examples/` directory. Adding a new test requires three files. Here's an example to add a test named "foo":

`examples/foo.html` (the template):

foo {{bar}}

`examples/foo.js` (the view context):

var foo = {
bar: "baz"
};

`examples/foo.txt` (the expected output):

foo baz

[jQuery]: http://jquery.com/ [jQuery]: http://jquery.com/
[Dojo]: http://www.dojotoolkit.org/ [Dojo]: http://www.dojotoolkit.org/
[Yui]: http://developer.yahoo.com/yui/ [Yui]: http://developer.yahoo.com/yui/
[CommonJS]: http://www.commonjs.org/ [CommonJS]: http://www.commonjs.org/
[Node.js]: http://nodejs.org/ [Node.js]: http://nodejs.org/
[Rhino Install]: http://michaux.ca/articles/installing-rhino-on-os-x

Načítá se…
Zrušit
Uložit