Permalink
Browse files

Switch to rspec.

  • Loading branch information...
jnunemaker committed Oct 10, 2012
1 parent 3799f65 commit ce348727cf6b3342f01766748025583dfba2798e
View
@@ -10,8 +10,6 @@ group(:debug) do
end
group(:test) do
- gem 'shoulda', '~> 2.11'
- gem 'jnunemaker-matchy', '~> 0.4.0', :require => 'matchy'
- gem 'mocha', '~> 0.9.8'
+ gem 'rspec'
gem 'log_buddy'
end
View
@@ -1,21 +1,7 @@
-require 'rubygems'
-require 'rake'
-require 'rake/testtask'
-require File.expand_path('../lib/plucky/version', __FILE__)
-
require 'bundler'
Bundler::GemHelper.install_tasks
-namespace :test do
- Rake::TestTask.new(:all) do |test|
- test.libs << 'lib' << 'test'
- test.pattern = 'test/**/test_*.rb'
- test.verbose = true
- end
-end
-
-task :test do
- Rake::Task['test:all'].invoke
-end
+require 'rspec/core/rake_task'
+RSpec::Core::RakeTask.new
-task :default => :test
+task :default => :spec
@@ -1,15 +1,15 @@
+$:.unshift(File.expand_path('../../lib', __FILE__))
+
require 'rubygems'
require 'bundler'
Bundler.require(:default, :test)
-$:.unshift File.expand_path(File.dirname(__FILE__) + '/../lib')
require 'plucky'
require 'fileutils'
require 'logger'
require 'pp'
-require 'set'
log_dir = File.expand_path('../../log', __FILE__)
FileUtils.mkdir_p(log_dir)
@@ -20,21 +20,25 @@
connection = Mongo::Connection.new('127.0.0.1', 27017, :logger => Log)
DB = connection.db('test')
-class Test::Unit::TestCase
- def setup
- DB.collections.map do |collection|
- collection.remove
- collection.drop_indexes
- end
- end
-
+module OrderedHashHelpers
def oh(*args)
BSON::OrderedHash.new.tap do |hash|
args.each { |a| hash[a[0]] = a[1] }
end
end
end
+RSpec.configure do |c|
+ c.include OrderedHashHelpers
+
+ c.before(:each) do
+ DB.collections.map do |collection|
+ collection.remove
+ collection.drop_indexes
+ end
+ end
+end
+
operators = %w{gt lt gte lte ne in nin mod all size exists}
operators.delete('size') if RUBY_VERSION >= '1.9.1'
SymbolOperators = operators
Oops, something went wrong.

0 comments on commit ce34872

Please sign in to comment.