upgrade to RSpec2

This commit is contained in:
stanislaw 2012-07-08 13:51:27 +03:00 committed by Ben Mabey
parent 5381eab37c
commit ee08c30de7
19 changed files with 73 additions and 48 deletions

4
.rspec Normal file
View file

@ -0,0 +1,4 @@
--color
--format documentation
mtime
--backtrace

2
.rvmrc
View file

@ -1 +1 @@
rvm ruby-1.8.7-p248 rvm 1.8.7

View file

@ -34,10 +34,13 @@ group :development do
gem "couch_potato", "0.3.0" gem "couch_potato", "0.3.0"
gem "sequel", "~>3.21.0" gem "sequel", "~>3.21.0"
#gem "ibm_db" # I don't want to add this dependency, even as a dev one since it requires DB2 to be installed #gem "ibm_db" # I don't want to add this dependency, even as a dev one since it requires DB2 to be installed
gem 'mysql'
gem 'mysql2', '~> 0.2.0'
gem 'pg'
end end
group :test do group :test do
gem "rspec" gem "rspec-rails"
gem "rspactor" gem "rspactor"
gem "rcov" gem "rcov"
gem "ZenTest" gem "ZenTest"

View file

@ -5,24 +5,24 @@ GEM
activerecord (2.3.8) activerecord (2.3.8)
activesupport (= 2.3.8) activesupport (= 2.3.8)
activesupport (2.3.8) activesupport (2.3.8)
addressable (2.2.0) addressable (2.2.8)
bson (1.0.4) bson (1.0.9)
builder (2.1.2) builder (2.1.2)
columnize (0.3.1) columnize (0.3.1)
couch_potato (0.3.0) couch_potato (0.3.0)
couchrest (>= 0.24) couchrest (>= 0.24)
json json
couchrest (1.0.1) couchrest (1.1.2)
json (>= 1.4.6) mime-types (~> 1.15)
mime-types (>= 1.15) multi_json (~> 1.0.0)
rest-client (>= 1.5.1) rest-client (~> 1.6.1)
cucumber (0.8.5) cucumber (0.8.5)
builder (~> 2.1.2) builder (~> 2.1.2)
diff-lcs (~> 1.1.2) diff-lcs (~> 1.1.2)
gherkin (~> 2.1.4) gherkin (~> 2.1.4)
json_pure (~> 1.4.3) json_pure (~> 1.4.3)
term-ansicolor (~> 1.0.4) term-ansicolor (~> 1.0.4)
data_objects (0.10.2) data_objects (0.10.8)
addressable (~> 2.1) addressable (~> 2.1)
datamapper (1.0.0) datamapper (1.0.0)
dm-aggregates (= 1.0.0) dm-aggregates (= 1.0.0)
@ -68,11 +68,11 @@ GEM
uuidtools (~> 2.1.1) uuidtools (~> 2.1.1)
dm-validations (1.0.0) dm-validations (1.0.0)
dm-core (~> 1.0.0) dm-core (~> 1.0.0)
do_sqlite3 (0.10.2) do_sqlite3 (0.10.8)
data_objects (= 0.10.2) data_objects (= 0.10.8)
durran-validatable (2.0.1) durran-validatable (2.0.1)
extlib (0.9.15) extlib (0.9.15)
fastercsv (1.5.3) fastercsv (1.5.5)
ffi (0.6.3) ffi (0.6.3)
rake (>= 0.8.7) rake (>= 0.8.7)
gemcutter (0.6.1) gemcutter (0.6.1)
@ -86,14 +86,14 @@ GEM
rubyforge (>= 2.0.0) rubyforge (>= 2.0.0)
jnunemaker-validatable (1.8.4) jnunemaker-validatable (1.8.4)
activesupport (>= 2.3.4) activesupport (>= 2.3.4)
json (1.4.6) json (1.7.3)
json_pure (1.4.6) json_pure (1.4.6)
libnotify (0.2.0) libnotify (0.2.0)
ffi (>= 0.6.2) ffi (>= 0.6.2)
linecache (0.43) linecache (0.43)
mime-types (1.16) mime-types (1.19)
mongo (1.0.7) mongo (1.0.9)
bson (>= 1.0.4) bson (>= 1.0.5)
mongo_mapper (0.8.2) mongo_mapper (0.8.2)
activesupport (>= 2.3.4) activesupport (>= 2.3.4)
jnunemaker-validatable (~> 1.8.4) jnunemaker-validatable (~> 1.8.4)
@ -104,13 +104,17 @@ GEM
durran-validatable (>= 2.0.1) durran-validatable (>= 2.0.1)
mongo (~> 1.0.1) mongo (~> 1.0.1)
will_paginate (< 2.9) will_paginate (< 2.9)
plucky (0.3.4) multi_json (1.0.4)
mongo (~> 1.0.7) mysql (2.8.1)
mysql2 (0.2.18)
pg (0.14.0)
plucky (0.3.5)
mongo (~> 1.0.8)
rake (0.8.7) rake (0.8.7)
rb-inotify (0.8.1) rb-inotify (0.8.1)
ffi (>= 0.5.0) ffi (>= 0.5.0)
rcov (0.9.8) rcov (0.9.8)
rest-client (1.6.0) rest-client (1.6.7)
mime-types (>= 1.16) mime-types (>= 1.16)
rspactor (0.7.0.beta.6) rspactor (0.7.0.beta.6)
bundler (>= 1.0.0.rc.5) bundler (>= 1.0.0.rc.5)
@ -119,7 +123,16 @@ GEM
rb-inotify rb-inotify
sys-uname (>= 0.8.4) sys-uname (>= 0.8.4)
trollop (>= 1.16.2) trollop (>= 1.16.2)
rspec (1.3.0) rspec (2.1.0)
rspec-core (~> 2.1.0)
rspec-expectations (~> 2.1.0)
rspec-mocks (~> 2.1.0)
rspec-core (2.1.0)
rspec-expectations (2.1.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.1.0)
rspec-rails (2.1.0)
rspec (~> 2.1.0)
ruby-debug (0.10.3) ruby-debug (0.10.3)
columnize (>= 0.1) columnize (>= 0.1)
ruby-debug-base (~> 0.10.3.0) ruby-debug-base (~> 0.10.3.0)
@ -134,8 +147,8 @@ GEM
term-ansicolor (1.0.5) term-ansicolor (1.0.5)
trollop (1.16.2) trollop (1.16.2)
tzinfo (0.3.22) tzinfo (0.3.22)
uuidtools (2.1.1) uuidtools (2.1.2)
will_paginate (2.3.14) will_paginate (2.3.16)
PLATFORMS PLATFORMS
ruby ruby
@ -153,10 +166,13 @@ DEPENDENCIES
json_pure json_pure
mongo_mapper (= 0.8.2) mongo_mapper (= 0.8.2)
mongoid (= 1.9.1) mongoid (= 1.9.1)
mysql
mysql2 (~> 0.2.0)
pg
rake rake
rcov rcov
rspactor rspactor
rspec rspec-rails
ruby-debug ruby-debug
sequel (~> 3.21.0) sequel (~> 3.21.0)
sqlite3-ruby sqlite3-ruby

View file

@ -28,16 +28,16 @@ Rake::RDocTask.new do |rdoc|
rdoc.rdoc_files.include('lib/**/*.rb') rdoc.rdoc_files.include('lib/**/*.rb')
end end
require 'spec/rake/spectask'
Spec::Rake::SpecTask.new(:spec) do |t| require 'rspec/core'
t.libs << 'lib' << 'spec' require 'rspec/core/rake_task'
t.spec_files = FileList['spec/**/*_spec.rb'] RSpec::Core::RakeTask.new(:spec) do |spec|
spec.pattern = FileList['spec/**/*_spec.rb']
end end
Spec::Rake::SpecTask.new(:rcov) do |t| RSpec::Core::RakeTask.new(:rcov) do |spec|
t.libs << 'lib' << 'spec' spec.pattern = 'spec/**/*_spec.rb'
t.spec_files = FileList['spec/**/*_spec.rb'] spec.rcov = true
t.rcov = true
end end
begin begin

View file

@ -5,7 +5,7 @@ require 'rubygems'
require 'bundler' require 'bundler'
Bundler.setup Bundler.setup
require 'spec/expectations' require 'rspec/expectations'
require 'ruby-debug' require 'ruby-debug'
DB_DIR = "#{File.dirname(__FILE__)}/../../db" DB_DIR = "#{File.dirname(__FILE__)}/../../db"

View file

@ -1,7 +1,7 @@
$LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../lib') $LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../lib')
require 'database_cleaner' require 'database_cleaner'
require 'spec/expectations' require 'rspec/expectations'
require 'test/unit/assertions' require 'test/unit/assertions'

View file

@ -1,7 +1,7 @@
require 'spec_helper' require 'spec_helper'
require 'active_record' require 'active_record'
require 'database_cleaner/active_record/base' require 'database_cleaner/active_record/base'
require 'database_cleaner/shared_strategy_spec' require 'database_cleaner/shared_strategy'
module DatabaseCleaner module DatabaseCleaner
describe ActiveRecord do describe ActiveRecord do

View file

@ -1,4 +1,4 @@
require File.dirname(__FILE__) + '/../spec_helper' require 'spec_helper'
module DatabaseCleaner module DatabaseCleaner
class << self class << self
@ -197,7 +197,7 @@ describe ::DatabaseCleaner do
# plausably want to force orm/strategy change on two sets of orm that differ only on db # plausably want to force orm/strategy change on two sets of orm that differ only on db
context "multiple orm proxy methods" do context "multiple orm proxy methods" do
it "should proxy orm to all connections and remove duplicate connections" do pending "should proxy orm to all connections and remove duplicate connections" do
active_record_1 = mock("active_mock_on_db_one").as_null_object active_record_1 = mock("active_mock_on_db_one").as_null_object
active_record_2 = mock("active_mock_on_db_two").as_null_object active_record_2 = mock("active_mock_on_db_two").as_null_object
data_mapper_1 = mock("data_mock_on_db_one").as_null_object data_mapper_1 = mock("data_mock_on_db_one").as_null_object

View file

@ -1,6 +1,6 @@
require 'spec_helper' require 'spec_helper'
require 'database_cleaner/data_mapper/base' require 'database_cleaner/data_mapper/base'
require 'database_cleaner/shared_strategy_spec' require 'database_cleaner/shared_strategy'
module DatabaseCleaner module DatabaseCleaner
describe DataMapper do describe DataMapper do

View file

@ -1,6 +1,6 @@
require File.dirname(__FILE__) + '/../../spec_helper' require File.dirname(__FILE__) + '/../../spec_helper'
require 'database_cleaner/data_mapper/transaction' require 'database_cleaner/data_mapper/transaction'
require 'database_cleaner/shared_strategy_spec' require 'database_cleaner/shared_strategy'
#require 'data_mapper' #require 'data_mapper'
module DatabaseCleaner module DatabaseCleaner

View file

@ -1,5 +1,5 @@
require 'database_cleaner/data_mapper/truncation' require 'database_cleaner/data_mapper/truncation'
require 'database_cleaner/shared_strategy_spec' require 'database_cleaner/shared_strategy'
module DatabaseCleaner module DatabaseCleaner
module DataMapper module DataMapper

View file

@ -1,5 +1,5 @@
require 'spec_helper' require 'spec_helper'
require 'database_cleaner/shared_strategy_spec' require 'database_cleaner/shared_strategy'
require 'database_cleaner/generic/base' require 'database_cleaner/generic/base'
module ::DatabaseCleaner module ::DatabaseCleaner

View file

@ -1,6 +1,6 @@
require 'spec_helper' require 'spec_helper'
require 'database_cleaner/mongo_mapper/base' require 'database_cleaner/mongo_mapper/base'
require 'database_cleaner/shared_strategy_spec' require 'database_cleaner/shared_strategy'
module DatabaseCleaner module DatabaseCleaner
describe MongoMapper do describe MongoMapper do

View file

@ -1,6 +1,6 @@
require 'spec_helper' require 'spec_helper'
require 'database_cleaner/sequel/base' require 'database_cleaner/sequel/base'
require 'database_cleaner/shared_strategy_spec' require 'database_cleaner/shared_strategy'
require 'sequel' require 'sequel'
module DatabaseCleaner module DatabaseCleaner

View file

@ -1,6 +1,6 @@
require 'spec_helper' require 'spec_helper'
require 'database_cleaner/sequel/transaction' require 'database_cleaner/sequel/transaction'
require 'database_cleaner/shared_strategy_spec' require 'database_cleaner/shared_strategy'
require 'sequel' require 'sequel'
module DatabaseCleaner module DatabaseCleaner

View file

@ -1,6 +1,6 @@
require 'spec_helper' require 'spec_helper'
require 'database_cleaner/sequel/truncation' require 'database_cleaner/sequel/truncation'
require 'database_cleaner/shared_strategy_spec' require 'database_cleaner/shared_strategy'
require 'sequel' require 'sequel'
module DatabaseCleaner module DatabaseCleaner

View file

@ -3,16 +3,18 @@ require "rubygems"
require "bundler" require "bundler"
Bundler.setup Bundler.setup
require 'rspec/core'
require 'rspec/mocks'
require 'spec'
#require 'active_record' #require 'active_record'
#require 'mongo_mapper' #require 'mongo_mapper'
$:.unshift(File.dirname(__FILE__))
$:.unshift(File.dirname(__FILE__) + '/../lib') $:.unshift(File.dirname(__FILE__) + '/../lib')
require 'database_cleaner' require 'database_cleaner'
RSpec.configure do |config|
Spec::Runner.configure do |config|
end end