vendor/plugins/haml/test/sass/plugin_test.rb in radiant-0.7.2 vs vendor/plugins/haml/test/sass/plugin_test.rb in radiant-0.8.0

- old
+ new

@@ -1,10 +1,6 @@ #!/usr/bin/env ruby - -MERB_ENV = RAILS_ENV = 'testing' -RAILS_ROOT = '.' - require File.dirname(__FILE__) + '/../test_helper' require 'sass/plugin' require 'fileutils' class SassPluginTest < Test::Unit::TestCase @@ -86,17 +82,26 @@ puts "\nmerb couldn't be loaded, skipping a test" return end require 'sass/plugin/merb' - MerbHandler.send(:define_method, :process_without_sass) { |*args| } + if defined?(MerbHandler) + MerbHandler.send(:define_method, :process_without_sass) { |*args| } + else + Merb::Rack::Application.send(:define_method, :call_without_sass) { |*args| } + end + set_plugin_opts File.delete(tempfile_loc('basic')) assert Sass::Plugin.stylesheet_needs_update?('basic') - MerbHandler.new('.').process nil, nil + if defined?(MerbHandler) + MerbHandler.new('.').process nil, nil + else + Merb::Rack::Application.new.call(::Rack::MockRequest.env_for('/')) + end assert !Sass::Plugin.stylesheet_needs_update?('basic') end def test_doesnt_render_partials @@ -149,7 +154,8 @@ old_render end end class ActionController::Base + undef :sass_old_process def sass_old_process(*args); end end