spec/spec_helper.rb in deface-1.0.0.rc1 vs spec/spec_helper.rb in deface-1.0.0.rc2
- old
+ new
@@ -2,14 +2,26 @@
SimpleCov.start 'rails'
require 'rspec'
require 'action_view'
require 'action_controller'
require 'deface'
-#have to manually require following three for testing purposes
+require 'rails/generators'
+#have to manually require following for testing purposes
require 'deface/action_view_extensions'
+
+#adding fake class as it's needed by haml 4.0, don't
+#want to have to require the entire rails stack in specs.
+module Rails
+ class Railtie
+ def self.initializer(*args)
+ end
+ end
+end
+
require 'haml'
require 'deface/haml_converter'
+require 'generators/deface/override_generator'
require 'time'
if defined?(Haml::Options)
# Haml 3.2 changes the default output format to HTML5
Haml::Options.defaults[:format] = :xhtml
@@ -42,13 +54,16 @@
if Rails.version[0..2] == '3.2'
Rails.application.config.stub :watchable_dirs => {}
end
+ Rails.stub :root => Pathname.new('spec/dummy')
+
Rails.stub :logger => mock('logger')
Rails.logger.stub(:error)
Rails.logger.stub(:warning)
Rails.logger.stub(:info)
+ Rails.logger.stub(:debug)
Time.stub :zone => mock('zone')
Time.zone.stub(:now).and_return Time.parse('1979-05-25')
require "haml/template/plugin"