Setup test framework
This commit is contained in:
6
Guardfile
Normal file
6
Guardfile
Normal 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
29
test/test_helper.rb
Normal 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'
|
||||
Reference in New Issue
Block a user