Permalink
Browse files

Add missing require for progressbar.

Cleared spec_helper.
  • Loading branch information...
1 parent b9f66fd commit 85bb9b51c54f18c8ddb1f9fe4e75bda539f8f3c2 quaternion committed Feb 1, 2012
Showing with 6 additions and 63 deletions.
  1. +2 −0 lib/transfer/transferer.rb
  2. +4 −63 spec/spec_helper.rb
@@ -1,3 +1,5 @@
+require 'progressbar'
+
class Transfer::Transferer
attr_reader :dataset, :klass
View
@@ -1,11 +1,7 @@
require 'rspec'
require 'rr'
-require 'transfer'
-require 'ostruct'
require 'fabrication'
-# require 'progress_bar'
-require 'progressbar'
-# require 'progress'
+require 'transfer'
require 'support/source'
require 'support/sequel'
require 'support/active_record'
@@ -14,42 +10,21 @@
RSpec.configure do |c|
c.mock_with :rr
- # c.before :all do
- # SourceUserMigration.apply SOURCE_DB, :up
- # SequelUserMigration.apply DESTINATION_DB, :up
- # SourceUser.db = SOURCE_DB
- # SequelUser.db = DESTINATION_DB
-#
- # ActiveRecordUserMigration.up
- # end
-
- c.before :suite do
- # SourceUserMigration.apply SOURCE_DB, :up
- # SequelUserMigration.apply DESTINATION_DB, :up
- # SourceUser.db = SOURCE_DB
- # SequelUser.db = DESTINATION_DB
- # {:connection => :two}
-
- # DatabaseCleaner.strategy = :transaction
- # DatabaseCleaner[:sequel].strategy = :truncation
+ c.before :suite do
DatabaseCleaner[:mongoid].strategy = :truncation
DatabaseCleaner[:active_record].strategy = :transaction
- # DatabaseCleaner[:sequel, {:connection => SOURCE_DB}].strategy = :transaction
- # DatabaseCleaner[:sequel, {:connection => DESTINATION_DB}].strategy = :truncation
- # DatabaseCleaner.clean_with :truncation
end
-
+
c.around do |example|
Sequel.transaction Sequel::DATABASES, :rollback => :always do
example.run
end
end
c.before :each do
- # DatabaseCleaner[:sequel].start
DatabaseCleaner.start
- # supress progress bar output
+ # supress progressbar output
any_instance_of(ProgressBar) do |pb|
stub(pb).inc
stub(pb).finish
@@ -58,39 +33,5 @@
c.after :each do
DatabaseCleaner.clean
- # DatabaseCleaner[:sequel].clean
- end
-end
-
-module RR
- module Adapters
- module RSpec2
-
- include RRMethods
-
- def setup_mocks_for_rspec
- RR.reset
- end
- def verify_mocks_for_rspec
- RR.verify
- end
- def teardown_mocks_for_rspec
- RR.reset
- end
-
- def have_received(method = nil)
- RR::Adapters::Rspec::InvocationMatcher.new(method)
- end
- end
end
end
-
-RSpec.configuration.backtrace_clean_patterns.push(RR::Errors::BACKTRACE_IDENTIFIER)
-
-module RSpec
- module Core
- module MockFrameworkAdapter
- include RR::Adapters::RSpec2
- end
- end
-end

0 comments on commit 85bb9b5

Please sign in to comment.