spec/spec_helper.rb in howitzer-1.1.1 vs spec/spec_helper.rb in howitzer-2.0.0

- old
+ new

@@ -1,26 +1,16 @@ require 'rubygems' require 'bundler/setup' require 'simplecov' require 'coveralls' -require 'tmpdir' -require 'ffaker' -require 'capybara' -require 'json' -require 'capybara/dsl' -require 'active_support' -require 'active_support/deprecation' -require 'active_support/deprecation/method_wrappers' -require 'active_support/core_ext' -require 'repeater' -require 'howitzer/exceptions' -require 'howitzer/utils/log' - -SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ +Coveralls.wear! +SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new( + [ SimpleCov::Formatter::HTMLFormatter, Coveralls::SimpleCov::Formatter -] + ] +) SimpleCov.start do add_filter '/spec/' add_filter '/config/' add_filter do |source_file| @@ -28,12 +18,40 @@ end add_group 'generators', '/generators' add_group 'lib', '/lib' end +require 'tmpdir' +require 'ffaker' +require 'capybara' +require 'json' +require 'capybara/dsl' +require 'active_support' +require 'active_support/deprecation' +require 'active_support/deprecation/method_wrappers' +require 'active_support/core_ext' +require 'repeater' +require 'sexy_settings' + +SexySettings.configure do |config| + config.path_to_default_settings = File.expand_path( + 'default.yml', + File.join(__dir__, '..', 'generators', 'config', 'templates') + ) + config.path_to_custom_settings = File.expand_path( + 'custom.yml', + File.join(__dir__, 'config') + ) +end + +puts SexySettings::Base.instance.as_formatted_text + +require 'howitzer' +require 'howitzer/exceptions' + def project_path - File.expand_path(File.join(File.dirname(__FILE__), '..')) + File.expand_path(File.join(__dir__, '..')) end def lib_path File.join(project_path, 'lib') end @@ -44,18 +62,18 @@ def log_path File.join(project_path, 'spec/log') end -Dir[File.join(File.dirname(__FILE__), 'support', '**', '*.rb')].each{ |f| require f } +Dir[File.join(__dir__, 'support', '**', '*.rb')].each { |f| require f } RSpec.configure do |config| - config.include GeneratorHelper + config.include Howitzer::GeneratorHelper config.disable_monkey_patching = true config.around(:each) do |ex| $stdout = StringIO.new $stderr = StringIO.new ex.run $stdout = STDOUT $stderr = STDERR end -end \ No newline at end of file +end