Notice: the tests are only expected to run on unixoid systems.
The mustache.js test suite uses the RSpec testing
framework. In order to run the tests you'll need to install Ruby
as well as the rake, rspec (>=2), and json RubyGems.
Tested on Ubuntu 10.10.
$ sudo apt-get install ruby1.8-dev
$ sudo apt-get install rubygems1.8
$ sudo gem install rake rspec
$ # needed to build native json extension for json gem
$ sudo apt-get install build-essential libreadline5-dev
$ sudo gem install json
Make sure you have the required tools to compile it:
$ apt-get install build-essential libssl-dev libreadline5-dev zlib1g-dev
Download and extract the Ruby source, and install it:
$ wget ftp://ftp.ruby-lang.org/pub/ruby/stable-snapshot.tar.gz
$ tar xvzf stable-snapshot.tar.gz
$ cd ruby
$ ./configure && make && make install
Download and extract RubyGems, and install it:
$ wget http://production.cf.rubygems.org/rubygems/rubygems-1.8.12.tgz
$ tar xzvf rubygems-1.8.12.tgz
$ cd rubygems-1.8.12
$ ruby setup.rb
If you want to update RubyGems:
$ gem update --system
Install the required gems:
$ gem install rake rspec json
That's it!
Notice: the version of node.js included in Ubuntu repositories is quite old. It is recommended to install node.js from source instead.
$ sudo apt-get install node
The mustache.js test suite currently uses 4 different JavaScript runtime engines to maximize portability across platforms and browsers. They are:
When the test suite runs it will automatically determine which platforms are available on your machine and run on all of them. The suite must run on at least one platform in order to succeed.
Once you have at least one JavaScript platform installed, you can run the test suite with the following command:
$ rake
All test files live in the spec/_files directory. To create a new test:
somename.mustachesomename.jssomename.txt