-
Notifications
You must be signed in to change notification settings - Fork 0
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
107 additions
and
2 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 @@ | ||
--colour |
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,47 @@ | ||
guard 'rails' do | ||
watch('Gemfile.lock') | ||
watch(%r{^(config|lib)/.*}) | ||
end | ||
|
||
guard 'livereload' do | ||
watch(%r{app/views/.+\.(erb|haml|slim)}) | ||
watch(%r{app/helpers/.+\.rb}) | ||
watch(%r{public/.+\.(css|js|html)}) | ||
watch(%r{config/locales/.+\.yml}) | ||
# Rails Assets Pipeline | ||
watch(%r{(app|vendor)/assets/\w+/(.+\.(css|js|html)).*}) { |m| "/assets/#{m[2]}" } | ||
end | ||
|
||
guard 'spork', :cucumber_env => { 'RAILS_ENV' => 'test' }, :rspec_env => { 'RAILS_ENV' => 'test' }, :wait => 45 do | ||
watch('config/application.rb') | ||
watch('config/environment.rb') | ||
watch(%r{^config/environments/.+\.rb$}) | ||
watch(%r{^config/initializers/.+\.rb$}) | ||
watch('Gemfile') | ||
watch('Gemfile.lock') | ||
watch('spec/spec_helper.rb') { :rspec } | ||
watch('test/test_helper.rb') { :test_unit } | ||
watch(%r{features/support/}) { :cucumber } | ||
end | ||
|
||
guard 'rspec', :version => 2, :cli => "--color --drb --tag ~no_drb --fail-fast -f #{ENV['RSPEC_FORMAT'] || 'progress'}", | ||
:bundler => false, :all_after_pass => false, :all_on_start => false do | ||
watch(%r{^spec/.+_spec\.rb$}) | ||
watch(%r{app/(.*)\.rb}) { |m| "spec/#{m[1]}_spec.rb" } | ||
watch(%r{app/(.*\.haml)}) { |m| "spec/#{m[1]}_spec.rb" } | ||
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" } | ||
watch('spec/spec_helper.rb') { "spec" } | ||
watch('spec/factories.rb') { "spec/models" } | ||
end | ||
|
||
guard 'pow' do | ||
watch('.powrc') | ||
watch('.powenv') | ||
watch('.rvmrc') | ||
watch('Gemfile') | ||
watch('Gemfile.lock') | ||
watch('config/application.rb') | ||
watch('config/environment.rb') | ||
watch(%r{^config/environments/.*\.rb$}) | ||
watch(%r{^config/initializers/.*\.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
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,55 @@ | ||
require 'rubygems' | ||
require 'spork' | ||
|
||
Spork.prefork do | ||
|
||
# This file is copied to spec/ when you run 'rails generate rspec:install' | ||
ENV["RAILS_ENV"] ||= 'test' | ||
|
||
if Spork.using_spork? | ||
require "rails/application" | ||
Spork.trap_method(Rails::Application::RoutesReloader, :reload!) | ||
end | ||
|
||
require File.expand_path("../../config/environment", __FILE__) | ||
|
||
require 'rspec/rails' | ||
require 'rspec/autorun' | ||
|
||
# Requires supporting ruby files with custom matchers and macros, etc, | ||
# in spec/support/ and its subdirectories. | ||
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} | ||
|
||
RSpec.configure do |config| | ||
|
||
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures | ||
# If you're not using ActiveRecord, or you'd prefer not to run each of your | ||
# examples within a transaction, remove the following line or assign false | ||
# instead of true. | ||
config.use_transactional_fixtures = true | ||
|
||
# If you're not using ActiveRecord, or you'd prefer not to run each of your | ||
# examples within a transaction, remove the following line or assign false | ||
# instead of true. | ||
config.fixture_path = "#{::Rails.root}/spec/fixtures" | ||
|
||
# If true, the base class of anonymous controllers will be inferred | ||
# automatically. This will be the default behavior in future versions of | ||
# rspec-rails. | ||
config.infer_base_class_for_anonymous_controllers = false | ||
end | ||
end | ||
|
||
Spork.each_run do | ||
Rails.logger.level = 4 | ||
|
||
# http://blog.plataformatec.com.br/2011/12/three-tips-to-improve-the-performance-of-your-test-suite/ | ||
class ActiveRecord::Base | ||
mattr_accessor :shared_connection | ||
@@shared_connection = nil | ||
|
||
def self.connection | ||
@@shared_connection || retrieve_connection | ||
end | ||
end | ||
end |