Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

14 лет назад
14 лет назад
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. ## Running the mustache.js Test Suite
  2. Notice: the tests are only expected to run on unixoid systems.
  3. The mustache.js test suite uses the [RSpec](http://rspec.info/) testing
  4. framework. In order to run the tests you'll need to install [Ruby](http://ruby-lang.org/)
  5. as well as the `rake`, `rspec` (>=2), and `json` [RubyGems](http://rubygems.org/).
  6. ### How to install Ruby and the required gems from source
  7. Make sure you have the required tools to compile it:
  8. $ apt-get install build-essential libssl-dev libreadline5-dev zlib1g-dev
  9. Download and extract the Ruby source, and install it:
  10. $ wget ftp://ftp.ruby-lang.org/pub/ruby/stable-snapshot.tar.gz
  11. $ tar xvzf stable-snapshot.tar.gz
  12. $ cd ruby
  13. $ ./configure && make && make install
  14. Download and extract RubyGems, and install it:
  15. $ wget http://production.cf.rubygems.org/rubygems/rubygems-1.8.12.tgz
  16. $ tar xzvf rubygems-1.8.12.tgz
  17. $ cd rubygems-1.8.12
  18. $ ruby setup.rb
  19. If you want to update RubyGems:
  20. $ gem update --system
  21. Install the required gems:
  22. $ gem install rake rspec json
  23. That's it!
  24. ### How to run the tests
  25. The mustache.js test suite currently uses 4 different JavaScript runtime engines
  26. to maximize portability across platforms and browsers. They are:
  27. * node
  28. * SpiderMonkey (Mozilla, Firefox)
  29. * JavaScriptCore (WebKit, Safari)
  30. * Rhino (Mozilla, Java)
  31. When the test suite runs it will automatically determine which platforms are
  32. available on your machine and run on all of them. The suite must run on at least
  33. one platform in order to succeed.
  34. Once you have at least one JavaScript platform installed, you can run the test
  35. suite with the following command:
  36. $ rake
  37. ### How to create a test
  38. All test files live in the spec/_files directory. To create a new test:
  39. * Create a template file `somename.mustache`
  40. * Create a javascript file with data and functions `somename.js`
  41. * Create a file the expected result `somename.txt`