Permalink
Browse files

Merge branch 'master' of github.com:haml/haml-spec

  • Loading branch information...
2 parents 1ffb233 + 1528820 commit 519e0703fc8306d81ffbae58fdd81e748b7bce5a @norman norman committed Jun 26, 2012
Showing with 7 additions and 7 deletions.
  1. +4 −4 README.md
  2. +3 −3 ruby_haml_test.rb
View
@@ -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.
View
@@ -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|
@@ -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

0 comments on commit 519e070

Please sign in to comment.