Skip to content

Commit

Permalink
Update echo to show working spork with watchr example
Browse files Browse the repository at this point in the history
  • Loading branch information
durran committed Oct 16, 2011
1 parent dfea45d commit c700e15
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 19 deletions.
1 change: 1 addition & 0 deletions .rspec
@@ -1,3 +1,4 @@
--colour
--drb
--format documentation
--fail-fast
1 change: 1 addition & 0 deletions Gemfile
Expand Up @@ -22,5 +22,6 @@ group :development, :test do
gem "fabrication"
gem "mocha"
gem "rspec-rails"
gem "spork", "~> 0.9.0.rc"
gem "watchr"
end
2 changes: 2 additions & 0 deletions Gemfile.lock
Expand Up @@ -128,6 +128,7 @@ GEM
sass (>= 3.1.4)
sprockets (~> 2.0.0)
tilt (~> 1.3.2)
spork (0.9.0.rc9)
sprockets (2.0.2)
hike (~> 1.2)
rack (~> 1.0)
Expand Down Expand Up @@ -165,6 +166,7 @@ DEPENDENCIES
rails (~> 3.1)
rspec-rails
sass-rails (~> 3.1)
spork (~> 0.9.0.rc)
uglifier
unicorn
watchr
5 changes: 5 additions & 0 deletions README.rdoc
Expand Up @@ -9,3 +9,8 @@
= Running Specs

* $ rake

= Running Specs with Watchr and Spork:

* $ spork
* $ bundle exec watchr .watchr
45 changes: 26 additions & 19 deletions spec/spec_helper.rb
@@ -1,26 +1,33 @@
# This file is copied to spec/ when you run "rails generate rspec:install"
require "rubygems"
require "spork"

ENV["RAILS_ENV"] ||= "test"
require File.expand_path("../../config/environment", __FILE__)
require "rspec/rails"

# 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}
Spork.prefork do
require File.expand_path("../../config/environment", __FILE__)
require "rspec/rails"

RSpec.configure do |config|
config.mock_with :mocha
# 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}
end

# Clean up all collections before each spec runs.
config.before do
Mongoid.purge!
end
Spork.each_run do
RSpec.configure do |config|
config.mock_with :mocha

# This filter is here to stub out the Facebook and Twitter services
# conveniently for each spec tagged with :following.
config.filter_run_including(service: ->(value) {
if value == :following
FollowingObserver.any_instance.stubs(:after_create)
# Clean up all collections before each spec runs.
config.before do
Mongoid.purge!
end
return true
})

# This filter is here to stub out the Facebook and Twitter services
# conveniently for each spec tagged with :following.
config.filter_run_including(service: ->(value) {
if value == :following
FollowingObserver.any_instance.stubs(:after_create)
end
return true
})
end
end

0 comments on commit c700e15

Please sign in to comment.