Przeglądaj źródła

Update testing instructions

tags/0.4.0
Michael Jackson 14 lat temu
rodzic
commit
846d1d3498
2 zmienionych plików z 62 dodań i 54 usunięć
  1. +62
    -0
      TESTING.md
  2. +0
    -54
      TESTS_HELP.md

+ 62
- 0
TESTING.md Wyświetl plik

@@ -0,0 +1,62 @@
## Running the mustache.js Test Suite

The mustache.js test suite uses the [RSpec](http://rspec.info/) testing
framework. In order to run the tests you'll need to install [Ruby](http://ruby-lang.org/)
as well as the `rake`, `rspec` (>=2), and `json` [RubyGems](http://rubygems.org/).

### How to install Ruby and the required gems from source

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!

### How to run the tests

The mustache.js test suite currently uses 4 different JavaScript runtime engines
to maximize portability across platforms and browsers. They are:

* node
* SpiderMonkey (Mozilla, Firefox)
* JavaScriptCore (WebKit, Safari)
* Rhino (Mozilla, Java)

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

### How to create a test

All test files live in the spec/_files directory. To create a new test:

* Create a template file `somename.mustache`
* Create a javascript file with data and functions `somename.js`
* Create a file the expected result `somename.txt`

+ 0
- 54
TESTS_HELP.md Wyświetl plik

@@ -1,54 +0,0 @@
## How to run the tests

To run the test, you need ruby and the following gems installed : rake, rspec (>=2), json

### How to install ruby and the required gems from source

Make sure you have the required tools to compile it

# apt-get install build-essential libssl-dev libreadline5-dev zlib1g-dev

Download ruby source and extract the source

$ cd ~/
$ wget ftp://ftp.ruby-lang.org/pub/ruby/stable-snapshot.tar.gz
$ tar xvzf stable-snapshot.tar.gz

Install it

$ ./configure && make
# make install

download the last version of RubyGems from here
http://rubyforge.org/frs/?group_id=126

Extract the source

$ tar xzvf rubygems-1.8.4.tgz

Install it

$ cd rubygems-1.8.4
# ruby setup.rb

If you want to update RubyGems

# gem update --system

Install the required gems

# gem install rake rspec json

That's it!

### How to run the tests

$ rake

### How to create a test

- Create a template file `somename.html`
- Create a javascript file with data and functions `somename.js`
- Create a file the expected result `somename.txt`

Done!

Ładowanie…
Anuluj
Zapisz