Sha256: 54e45afecc60f1094ae132724039c3bb9133ab98d88d785f769715a1f26b9677

Contents?: true

Size: 1.67 KB

Versions: 87

Compression:

Stored size: 1.67 KB

Contents

require "rubygems"
require "bundler"
Bundler.setup(:default, :development)

$:.unshift(File.dirname(__FILE__) + '/../lib')
require 'test/unit'
require 'active_support'
require 'active_record'
require 'active_record/fixtures'
require 'active_record/test_case'

begin
  require 'ruby-debug'
  Debugger.start
rescue LoadError
end

require 'acts_as_versioned'

config = YAML::load(IO.read(File.dirname(__FILE__) + '/database.yml'))
ActiveRecord::Base.logger = Logger.new(File.dirname(__FILE__) + "/debug.log")
ActiveRecord::Base.configurations = {'test' => config[ENV['DB'] || 'sqlite3']}
ActiveRecord::Base.establish_connection(ActiveRecord::Base.configurations['test'])

load(File.dirname(__FILE__) + "/schema.rb")

# set up custom sequence on widget_versions for DBs that support sequences
if ENV['DB'] == 'postgresql'
  ActiveRecord::Base.connection.execute "DROP SEQUENCE widgets_seq;" rescue nil
  ActiveRecord::Base.connection.remove_column :widget_versions, :id
  ActiveRecord::Base.connection.execute "CREATE SEQUENCE widgets_seq START 101;"
  ActiveRecord::Base.connection.execute "ALTER TABLE widget_versions ADD COLUMN id INTEGER PRIMARY KEY DEFAULT nextval('widgets_seq');"
end

class ActiveSupport::TestCase #:nodoc:
  include ActiveRecord::TestFixtures

  self.fixture_path = File.dirname(__FILE__) + "/fixtures/"
  
  # Turn off transactional fixtures if you're working with MyISAM tables in MySQL
  self.use_transactional_fixtures = true

  # Instantiated fixtures are slow, but give you @david where you otherwise would need people(:david)
  self.use_instantiated_fixtures  = false

  # Add more helper methods to be used by all tests here...
end

$:.unshift(ActiveSupport::TestCase.fixture_path)

Version data entries

87 entries across 87 versions & 11 rubygems

Version Path
imagine_cms-5.2.6 lib/acts_as_versioned/test/abstract_unit.rb
imagine_cms-5.2.5 lib/acts_as_versioned/test/abstract_unit.rb
imagine_cms-5.2.4 lib/acts_as_versioned/test/abstract_unit.rb
imagine_cms-5.2.3 lib/acts_as_versioned/test/abstract_unit.rb
imagine_cms-5.2.2 lib/acts_as_versioned/test/abstract_unit.rb
imagine_cms-5.2.1 lib/acts_as_versioned/test/abstract_unit.rb
imagine_cms-5.2.0 lib/acts_as_versioned/test/abstract_unit.rb
imagine_cms-4.2.4 lib/acts_as_versioned/test/abstract_unit.rb
imagine_cms-4.1.4 lib/acts_as_versioned/test/abstract_unit.rb
imagine_cms-4.2.3 lib/acts_as_versioned/test/abstract_unit.rb
imagine_cms-4.2.2 lib/acts_as_versioned/test/abstract_unit.rb
imagine_cms-4.2.1 lib/acts_as_versioned/test/abstract_unit.rb
imagine_cms-4.2.0 lib/acts_as_versioned/test/abstract_unit.rb
imagine_cms-4.1.3 lib/acts_as_versioned/test/abstract_unit.rb
keeguon-acts_as_versioned-0.7.4 test/abstract_unit.rb
imagine_cms-4.1.2 lib/acts_as_versioned/test/abstract_unit.rb
imagine_cms-4.1.1 lib/acts_as_versioned/test/abstract_unit.rb
imagine_cms-4.1.0 lib/acts_as_versioned/test/abstract_unit.rb
gluttonberg_acts_as_versioned-2.0.0 test/abstract_unit.rb
imagine_cms-4.0.1 lib/acts_as_versioned/test/abstract_unit.rb