Skip to content

Commit

Permalink
Run generator on the dummy app
Browse files Browse the repository at this point in the history
  • Loading branch information
elskwid committed Sep 23, 2012
1 parent 9d87095 commit 9ba6c68
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/dummy/.gitignore
@@ -0,0 +1 @@
coverage
17 changes: 17 additions & 0 deletions test/dummy/Guardfile
@@ -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

10 changes: 10 additions & 0 deletions test/dummy/lib/tasks/test.rake
@@ -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
36 changes: 36 additions & 0 deletions test/dummy/test/minitest_helper.rb
@@ -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!

0 comments on commit 9ba6c68

Please sign in to comment.