Skip to content

Commit

Permalink
Merge branch 'master' of github.com:haml/haml-spec
Browse files Browse the repository at this point in the history
  • Loading branch information
norman committed Jun 26, 2012
2 parents 1ffb233 + 1528820 commit 519e070
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@ feature.

### Ruby ###

In order to make it as easy as possible for non-Ruby programmers to run the
Ruby Haml tests, the Ruby test runner uses test/unit, rather than something
fancier like Rspec. To run them you probably only need to install `haml`, and
The Ruby test runner uses minitest, the same as the Ruby Haml implementation.
To run the tests you probably only need to install `haml`, `minitest` and
possibly `ruby` if your platform doesn't come with it by default. If you're
using Ruby 1.8.x, you'll also need to install `json`:

sudo gem install haml
sudo gem install minitest
# for Ruby 1.8.x; check using "ruby --version" if unsure
sudo gem install json

Then, running the Ruby test suite is easy:

ruby -rminitest/autorun ruby_haml_test.rb
ruby ruby_haml_test.rb

At the moment, running the tests with Ruby 1.8.7 fails because of issues with
the JSON library. Please use 1.9.2 until this is resolved.
Expand Down
6 changes: 3 additions & 3 deletions ruby_haml_test.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
require "rubygems"
require "test/unit"
require "minitest/autorun"
require "json"
require "haml"

class HamlTest < Test::Unit::TestCase
class HamlTest < MiniTest::Unit::TestCase
contexts = JSON.parse(File.read(File.dirname(__FILE__) + "/tests.json"))
contexts.each do |context|
context[1].each do |name, test|
Expand All @@ -13,7 +13,7 @@ class HamlTest < Test::Unit::TestCase
locals = Hash[(test["locals"] || {}).map {|x, y| [x.to_sym, y]}]
options = Hash[(test["config"] || {}).map {|x, y| [x.to_sym, y]}]
options[:format] = options[:format].to_sym if options.key?(:format)
engine = Haml::Engine.new(test["haml"], options)
engine = Haml::Engine.new(haml, options)
result = engine.render(Object.new, locals)

assert_equal html, result.strip
Expand Down

0 comments on commit 519e070

Please sign in to comment.