diff --git a/Gemfile b/Gemfile index 108f6b4c..834e43f8 100644 --- a/Gemfile +++ b/Gemfile @@ -29,7 +29,6 @@ gem 'haml', '>= 3.0' gem 'sass' gem 'builder' gem 'erubis' -gem 'less', '~> 2.0' gem 'liquid' gem 'slim', '~> 1.0' gem 'temple', '!= 0.3.3' @@ -47,6 +46,12 @@ else gem 'nokogiri' end +if RUBY_ENGINE == "ruby" + gem 'less', '~> 2.0' +else + gem 'less', '~> 1.0' +end + unless RUBY_ENGINE == 'jruby' && JRUBY_VERSION < "1.6.1" && !ENV['TRAVIS'] # C extensions gem 'rdiscount' diff --git a/test/less_test.rb b/test/less_test.rb index 21014e31..979f201c 100644 --- a/test/less_test.rb +++ b/test/less_test.rb @@ -16,7 +16,7 @@ class LessTest < Test::Unit::TestCase it 'renders inline Less strings' do less_app { less "@white_color: #fff; #main { background-color: @white_color }" } assert ok? - assert_body "#main {background-color: #ffffff;}" + assert_equal "#main{background-color:#ffffff;}", body.gsub(/\s/, "") end it 'defaults content type to css' do @@ -45,13 +45,13 @@ class LessTest < Test::Unit::TestCase it 'renders .less files in views path' do less_app { less :hello } assert ok? - assert_body "#main {background-color: #ffffff;}" + assert_equal "#main{background-color:#ffffff;}", body.gsub(/\s/, "") end it 'ignores the layout option' do less_app { less :hello, :layout => :layout2 } assert ok? - assert_body "#main {background-color: #ffffff;}" + assert_equal "#main{background-color:#ffffff;}", body.gsub(/\s/, "") end it "raises error if template not found" do