spec/spec_helper.rb in taza-0.8.0 vs spec/spec_helper.rb in taza-0.8.2

- old
+ new

@@ -2,23 +2,30 @@ require 'spec' require 'mocha' require 'config/vendorized_gems' lib_path = File.expand_path("#{File.dirname(__FILE__)}/../lib") $LOAD_PATH.unshift lib_path unless $LOAD_PATH.include?(lib_path) -TMP_ROOT = File.join(File.dirname(__FILE__),"sandbox","generated") -PROJECT_NAME = 'example' -PROJECT_FOLDER = File.join(TMP_ROOT,PROJECT_NAME) Spec::Runner.configure do |config| config.mock_with :mocha end def null_device - Taza.windows? ? 'NUL': '/dev/null' + File.exists?('/dev/null') ? '/dev/null' : 'NUL' end +#### Rubigen helpers +require 'rubigen' +require 'rubigen/helpers/generator_test_helper' + +# Must set before requiring generator libs. +TMP_ROOT = File.join(File.dirname(__FILE__),"sandbox","generated") +PROJECT_NAME = 'example' +PROJECT_FOLDER = File.join(TMP_ROOT,PROJECT_NAME) +APP_ROOT = File.join(TMP_ROOT, PROJECT_NAME) + def generator_sources [RubiGen::PathSource.new(:test, File.join(File.dirname(__FILE__),"..","lib", "app_generators")), RubiGen::PathSource.new(:test, File.join(File.dirname(__FILE__),"..", "generators"))] end @@ -45,5 +52,6 @@ stub_browser.stubs(:close) ::Taza::Browser.stubs(:create).returns(stub_browser) end end end +#### Rubigen helpers end