clean code + rspec works smoothly now

This commit is contained in:
dinedine 2010-04-09 14:03:54 +02:00
parent 4e16509531
commit ff6fcf43f1
3 changed files with 9 additions and 28 deletions

13
Gemfile
View File

@ -7,7 +7,7 @@ gem "rails", "3.0.0.beta2"
gem "liquid"
gem "bson_ext"
gem "mongo_ext"
gem "mongoid", ">= 2.0.0.beta"
gem "mongoid", ">= 2.0.0.beta2"
gem "warden"
gem "devise", ">= 1.1.rc0"
@ -22,13 +22,6 @@ group :development do
end
group :test do
gem 'rspec-rails', '>= 2.0.0.beta.4'
gem 'rspec-rails', '>= 2.0.0.beta.5'
gem 'factory_girl', :git => 'git://github.com/thoughtbot/factory_girl.git', :branch => 'rails3'
end
# gem 'rspec', '>= 2.0.0.beta.4'
# gem 'rspec-rails', '>= 2.0.0.beta.4'
gem 'factory_girl', :git => 'git://github.com/thoughtbot/factory_girl.git', :branch => 'rails3'
# gem "shoulda", :git => "git://github.com/sinefunc/shoulda.git", :branch => "rails3"
# gem "shoulda", :git => "git://github.com/bmaddy/shoulda.git", :branch => "rails3", :require => nil

View File

@ -1,9 +1,4 @@
begin
require "rubygems"
require "bundler"
Bundler.require :default, :test
require 'rspec/core'
require 'rspec/core/rake_task'
rescue MissingSourceFile
@ -33,7 +28,7 @@ end
Rake.application.instance_variable_get('@tasks').delete('default')
spec_prereq = :noop #File.exist?(File.join(Rails.root, 'config', 'database.yml')) ? "db:test:prepare" : :noop
spec_prereq = :noop # we are using mongoid and not ActiveRecord, no need to prepare the test database
task :noop do
end

View File

@ -9,16 +9,9 @@ require 'rspec/rails'
Dir["#{File.dirname(__FILE__)}/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
# If you'd prefer not to run each of your examples within a transaction,
# uncomment the following line.
# config.use_transactional_examples false
config.before(:each) do
Mongoid.master.collections.each(&:drop)
end
end