Setup test framework

This commit is contained in:
Mark Maglana
2013-08-22 00:15:22 -07:00
parent 6a3420cbe5
commit 4e247ce6e9
2 changed files with 35 additions and 0 deletions

6
Guardfile Normal file
View File

@@ -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

29
test/test_helper.rb Normal file
View File

@@ -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'