From ff6fcf43f1fac30cea7c6dc11d5aa67a942cf829 Mon Sep 17 00:00:00 2001 From: dinedine Date: Fri, 9 Apr 2010 14:03:54 +0200 Subject: [PATCH] clean code + rspec works smoothly now --- Gemfile | 15 ++++----------- lib/tasks/rspec.rake | 7 +------ spec/spec_helper.rb | 15 ++++----------- 3 files changed, 9 insertions(+), 28 deletions(-) diff --git a/Gemfile b/Gemfile index ecb5eff1..73be442f 100644 --- a/Gemfile +++ b/Gemfile @@ -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' -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 + gem 'rspec-rails', '>= 2.0.0.beta.5' + gem 'factory_girl', :git => 'git://github.com/thoughtbot/factory_girl.git', :branch => 'rails3' +end \ No newline at end of file diff --git a/lib/tasks/rspec.rake b/lib/tasks/rspec.rake index 01e164ca..1571c1d7 100644 --- a/lib/tasks/rspec.rake +++ b/lib/tasks/rspec.rake @@ -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 diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 7b590ab0..be539a7e 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -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