Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add Spork and Watchr

  • Loading branch information...
commit 950484805a571908c7dc66e9dff63b2db10d4fad 1 parent 7b91258
@jeffkreeftmeijer jeffkreeftmeijer authored
View
1  .rspec
@@ -1,2 +1,3 @@
--format Fuubar
--colour
+--drb
View
18 .watchr
@@ -0,0 +1,18 @@
+def run_spec(file)
+ unless File.exist?(file)
+ puts "#{file} does not exist"
+ return
+ end
+
+ puts "Running #{file}"
+ system "bundle exec rspec #{file}"
+ puts
+end
+
+watch("spec/.*/*_spec\.rb") do |match|
+ run_spec match[0]
+end
+
+watch("app/(.*/.*)\.rb") do |match|
+ run_spec %{spec/#{match[1]}_spec.rb}
+end
View
3  Gemfile
@@ -21,5 +21,8 @@ group :test do
gem 'machinist_mongo', :require => 'machinist/mongoid'
gem 'faker'
+ gem 'spork', '~> 0.9.0.rc'
+ gem 'watchr'
+
gem 'fuubar'
end
View
4 Gemfile.lock
@@ -135,6 +135,7 @@ GEM
ffi (>= 1.0.7)
json_pure
rubyzip
+ spork (0.9.0.rc7)
sprockets (2.0.0.beta.6)
hike (~> 1.0)
rack (~> 1.0)
@@ -148,6 +149,7 @@ GEM
uglifier (0.5.4)
execjs (>= 0.3.0)
multi_json (>= 1.0.2)
+ watchr (0.7)
xpath (0.1.4)
nokogiri (~> 1.3)
@@ -168,5 +170,7 @@ DEPENDENCIES
rails (= 3.1.0.rc1)
rspec-rails
sass
+ spork (~> 0.9.0.rc)
sqlite3
uglifier
+ watchr
View
4 lib/tasks/watchr.rake
@@ -0,0 +1,4 @@
+desc "Run watchr"
+task :watchr do
+ sh %{bundle exec watchr .watchr}
+end
View
42 spec/spec_helper.rb
@@ -1,21 +1,29 @@
-# This file is copied to spec/ when you run 'rails generate rspec:install'
-ENV["RAILS_ENV"] ||= 'test'
-require File.expand_path("../../config/environment", __FILE__)
-require 'rspec/rails'
+require 'spork'
-require 'blueprints'
+Spork.prefork do
-# 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}
+ ENV["RAILS_ENV"] ||= 'test'
+ require File.expand_path("../../config/environment", __FILE__)
+ require 'rspec/rails'
-RSpec.configure do |config|
- # == Mock Framework
- #
- # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
- #
- # config.mock_with :mocha
- # config.mock_with :flexmock
- # config.mock_with :rr
- config.mock_with :rspec
+ require 'blueprints'
+
+ # 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|
+ # == Mock Framework
+ #
+ # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
+ #
+ # config.mock_with :mocha
+ # config.mock_with :flexmock
+ # config.mock_with :rr
+ config.mock_with :rspec
+ end
+
+end
+
+Spork.each_run do
end
View
5 spec/support/blueprints.rb
@@ -0,0 +1,5 @@
+require 'machinist/mongoid'
+
+Contest.blueprint do
+ name 'Contest!'
+end
Please sign in to comment.
Something went wrong with that request. Please try again.