diff --git a/Guardfile b/Guardfile new file mode 100644 index 0000000..dff262e --- /dev/null +++ b/Guardfile @@ -0,0 +1,6 @@ +guard 'minitest' do + watch(%r|^lib/aviator\.rb|) { "test" } + watch(%r|^test/test_helper\.rb|) { "test" } + watch(%r|^lib/aviator/(.*)\.rb|) { |m| "test/aviator/#{m[1]}_test.rb" } + watch(%r|^test/aviator/.*_test\.rb|) # Run the matched file +end diff --git a/test/test_helper.rb b/test/test_helper.rb new file mode 100644 index 0000000..33921ee --- /dev/null +++ b/test/test_helper.rb @@ -0,0 +1,29 @@ +# Add the gem's lib folder to the load path +$:.unshift File.expand_path('../../lib', __FILE__) + + +# Set-up coverage reporting (local and Coveralls.com) +require 'simplecov' +require 'coveralls' +SimpleCov.command_name 'MiniTest' +SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ + SimpleCov::Formatter::HTMLFormatter, + Coveralls::SimpleCov::Formatter +] +SimpleCov.start do + add_filter '/test/' +end + +require 'minitest/autorun' + +# Do not require these gems when running in the CI +unless ENV['CI'] || ENV['TRAVIS'] + require 'pry' +end + +# Load all helpers in test/support +Dir[Pathname.new(__FILE__).join('..', 'support', '*.rb')].each do |f| + require f +end + +require 'aviator'