spec/spec_helper.rb in imap-backup-1.0.9 vs spec/spec_helper.rb in imap-backup-1.0.10
- old
+ new
@@ -1,37 +1,20 @@
require 'rspec'
+spec_path = File.dirname(__FILE__)
+$LOAD_PATH << File.expand_path('../lib', spec_path)
+support_glob = File.join(spec_path, 'support', '**', '*.rb')
+Dir[support_glob].each { |f| require f }
+
if RUBY_VERSION < '1.9'
require 'rspec/autorun'
else
require 'simplecov'
- if defined?(GATHER_RSPEC_COVERAGE)
- SimpleCov.start do
- add_filter "/spec/"
- add_filter "/vendor/"
- end
+ SimpleCov.start do
+ add_filter '/spec/'
+ add_filter '/vendor/'
end
end
-require File.expand_path(File.dirname(__FILE__) + '/../lib/imap/backup')
+require 'imap/backup'
-module HighLineTestHelpers
- def prepare_highline
- @input = stub('stdin', :eof? => false)
- # default gets stub
- @input.stub!(:gets).with().and_return("q\n")
- @output = StringIO.new
- Imap::Backup::Configuration::Setup.highline = HighLine.new(@input, @output)
- [@input, @output]
- end
-end
-
-module InputOutputTestHelpers
- def capturing_output
- output = StringIO.new
- $stdout = output
- yield
- output.string
- ensure
- $stdout = STDOUT
- end
-end
+silence_logging