diff --git a/lib/guard/ui.rb b/lib/guard/ui.rb index 2127370..bb3f96e 100644 --- a/lib/guard/ui.rb +++ b/lib/guard/ui.rb @@ -10,8 +10,10 @@ module Guard end def error(message, options = {}) - reset_line if options[:reset] - puts "ERROR: #{message}" + unless ENV["GUARD_ENV"] == "test" + reset_line if options[:reset] + puts "ERROR: #{message}" + end end def debug(message, options = {}) diff --git a/spec/guard_spec.rb b/spec/guard_spec.rb index cb0429c..62669e7 100644 --- a/spec/guard_spec.rb +++ b/spec/guard_spec.rb @@ -1,19 +1,5 @@ require 'spec_helper' -# mute UI -module Guard::UI - class << self - def info(message, options = {}) - end - - def error(message) - end - - def debug(message) - end - end -end - describe Guard do describe "Class Methods" do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index fe70582..bbbe914 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -2,6 +2,8 @@ require 'rubygems' require 'guard' require 'rspec' +ENV["GUARD_ENV"] = 'test' + Dir["#{File.expand_path('..', __FILE__)}/support/**/*.rb"].each { |f| require f } puts "Please do not update/create files while tests are running." @@ -9,13 +11,11 @@ puts "Please do not update/create files while tests are running." RSpec.configure do |config| config.color_enabled = true + config.filter_run :focus => true + config.run_all_when_everything_filtered = true + config.before(:each) do - ENV["GUARD_ENV"] = 'test' @fixture_path = Pathname.new(File.expand_path('../fixtures/', __FILE__)) end - - config.after(:each) do - ENV["GUARD_ENV"] = nil - end end \ No newline at end of file