Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# A sample Guardfile | ||
# More info at https://github.com/guard/guard#readme | ||
|
||
guard "minitest" do | ||
# with Minitest::Spec | ||
watch(%r|^test/(.*)_test\.rb|) | ||
watch(%r|^lib/(.*)([^/]+)\.rb|) { |m| "test/#{m[1]}#{m[2]}_test.rb" } | ||
watch(%r|^test/minitest_helper\.rb|) { "test" } | ||
watch(%r|^test/support/|) { "test" } | ||
|
||
# Rails 3.2 | ||
watch(%r|^app/controllers/(.*)\.rb|) { |m| "test/controllers/#{m[1]}_test.rb" } | ||
watch(%r|^app/mailers/(.*)\.rb|) { |m| "test/mailers/#{m[1]}_test.rb" } | ||
watch(%r|^app/helpers/(.*)\.rb|) { |m| "test/helpers/#{m[1]}_test.rb" } | ||
watch(%r|^app/models/(.*)\.rb|) { |m| "test/models/#{m[1]}_test.rb" } | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
require "rake/testtask" | ||
|
||
task default: :test | ||
|
||
Rake::TestTask.new(:test) do |t| | ||
t.libs << "lib" | ||
t.libs << "test" | ||
t.pattern = "test/**/*_test.rb" | ||
t.verbose = false | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
if RUBY_ENGINE == "ruby" | ||
begin | ||
require "simplecov" | ||
SimpleCov.add_filter "test" | ||
SimpleCov.add_filter "config" | ||
SimpleCov.command_name "MiniTest" | ||
SimpleCov.start | ||
rescue LoadError | ||
warn "unable to load SimpleCov" | ||
end | ||
end | ||
|
||
ENV["RAILS_ENV"] = "test" | ||
require File.expand_path('../../config/environment', __FILE__) | ||
|
||
require "minitest/autorun" | ||
require "minitest/rails" | ||
require "minitest/pride" # Provides awesome colorful output | ||
|
||
# Uncomment if you want Capybara in accceptance/integration tests | ||
# require "minitest/rails/capybara" | ||
|
||
require "mocha" | ||
|
||
# Requires supporting ruby files with custom matchers and macros, etc, | ||
# in spec/support/ and its subdirectories. | ||
Dir[File.join("./test/support/**/*.rb")].sort.each { |f| require f } | ||
|
||
class MiniTest::Rails::ActiveSupport::TestCase | ||
# Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order. | ||
# fixtures :all | ||
|
||
# Add more helper methods to be used by all tests here... | ||
end | ||
|
||
MiniTest::Rails.override_testunit! |