Skip to content

Commit

Permalink
spork と autotest 導入。rspec を 2.0.0 に
Browse files Browse the repository at this point in the history
  • Loading branch information
jugyo committed Oct 11, 2010
1 parent 6a54576 commit 28a62a5
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 45 deletions.
2 changes: 1 addition & 1 deletion .rspec
@@ -1 +1 @@
--colour -fs
--colour -fs --drb
4 changes: 3 additions & 1 deletion Gemfile
Expand Up @@ -33,8 +33,10 @@ gem 'twitter-auth',
# and rake tasks are available in development mode:
group :development, :test do
gem 'ruby-debug19', :require => 'ruby-debug'
gem 'rspec-rails', '2.0.0.beta.22'
gem 'rspec-rails', '2.0.0'
gem 'haml-rails'
gem 'g'
gem 'factory_girl'
gem 'spork'
gem 'autotest'
end
28 changes: 16 additions & 12 deletions Gemfile.lock
Expand Up @@ -40,6 +40,7 @@ GEM
archive-tar-minitar (0.5.2)
arel (1.0.1)
activesupport (~> 3.0.0)
autotest (4.4.1)
bson (1.0.4)
bson_ext (1.0.4)
builder (2.1.2)
Expand Down Expand Up @@ -92,18 +93,18 @@ GEM
rake (>= 0.8.4)
thor (~> 0.14.0)
rake (0.8.7)
rspec (2.0.0.beta.22)
rspec-core (= 2.0.0.beta.22)
rspec-expectations (= 2.0.0.beta.22)
rspec-mocks (= 2.0.0.beta.22)
rspec-core (2.0.0.beta.22)
rspec-expectations (2.0.0.beta.22)
rspec (2.0.0)
rspec-core (= 2.0.0)
rspec-expectations (= 2.0.0)
rspec-mocks (= 2.0.0)
rspec-core (2.0.0)
rspec-expectations (2.0.0)
diff-lcs (>= 1.1.2)
rspec-mocks (2.0.0.beta.22)
rspec-core (= 2.0.0.beta.22)
rspec-expectations (= 2.0.0.beta.22)
rspec-rails (2.0.0.beta.22)
rspec (= 2.0.0.beta.22)
rspec-mocks (2.0.0)
rspec-core (= 2.0.0)
rspec-expectations (= 2.0.0)
rspec-rails (2.0.0)
rspec (= 2.0.0)
ruby-debug-base19 (0.11.24)
columnize (>= 0.3.1)
linecache19 (>= 0.5.11)
Expand All @@ -115,6 +116,7 @@ GEM
ruby-growl (2.0)
ruby_core_source (0.1.4)
archive-tar-minitar (>= 0.5.2)
spork (0.8.4)
thor (0.14.0)
treetop (1.4.8)
polyglot (>= 0.3.1)
Expand All @@ -127,13 +129,15 @@ PLATFORMS
ruby

DEPENDENCIES
autotest
bson_ext (= 1.0.4)
factory_girl
g
haml-rails
mongoid (= 2.0.0.beta.18)
rails (= 3.0.0)
rspec-rails (= 2.0.0.beta.22)
rspec-rails (= 2.0.0)
ruby-debug19
spork
twitter-auth!
unicorn
84 changes: 53 additions & 31 deletions spec/spec_helper.rb
@@ -1,33 +1,55 @@
# 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'

# 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}

Mongoid.master.collections.each {|c| c.drop rescue nil}

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

# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
# config.fixture_path = "#{::Rails.root}/spec/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

config.before do
Mongoid.master.collections.each(&:remove)
require 'rubygems'
require 'spork'

# --- Instructions ---
# - Sort through your spec_helper file. Place as much environment loading
# code that you don't normally modify during development in the
# Spork.prefork block.
# - Place the rest under Spork.each_run block
# - Any code that is left outside of the blocks will be ran during preforking
# and during each_run!
# - These instructions should self-destruct in 10 seconds. If they don't,
# feel free to delete them.

Spork.prefork do
# Loading more in this block will cause your tests to run faster. However,
# if you change any configuration or code from libraries loaded here, you'll
# need to restart spork for it take effect.

# 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'
# 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}

Mongoid.master.collections.each {|c| c.drop rescue nil}

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

# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
# config.fixture_path = "#{::Rails.root}/spec/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

config.before do
Mongoid.master.collections.each(&:remove)
end
end
end

Spork.each_run do
# This code will be run each time you run your specs.
end

0 comments on commit 28a62a5

Please sign in to comment.