Sha256: 13518830aef56aa3205777a194192811e0556ff31312748902d241fd58c66921
Contents?: true
Size: 1.46 KB
Versions: 28
Compression:
Stored size: 1.46 KB
Contents
require 'lib/fossil' require 'spec' require 'rr' unless defined?(DB_DEMO) DB_DEMO = Sequel.odbc('demodata')#, :loggers=>[Logger.new($stdout)]) DB_DEMO.extend(Sequel::Pervasive::DatabaseMethods) DB_FOS = Sequel.odbc('fos')#, :loggers=>[Logger.new($stdout)]) DB_FOS.extend(Sequel::Pervasive::DatabaseMethods) end require File.dirname(__FILE__) + "/helper_methods" require File.dirname(__FILE__) + "/helper_classes" ##### custom matchers ##### require File.dirname(__FILE__) + "/be_model_with_values_matcher" Spec::Runner.configure do |config| config.include(HelperMethods) config.mock_with :rr config.include(BeModelWithValuesMatcher) end # These are special modifictations for testing with mysql db instead of pervasive # if its not windows or linux where pervasive db is running ) .. modify the # pervasive adapter to act more like mysql, so that the tests can still run. # This is not ideal, but it works unless RUBY_PLATFORM =~ /mswin32|linux/ module Sequel::Pervasive::DatabaseMethods def auto_increment_sql; "AUTO_INCREMENT" end def begin_transaction_sql; "BEGIN" end def commit_transaction_sql; "COMMIT" end def rollback_transaction_sql; "ROLLBACK" end end module Sequel::Pervasive::DatasetMethods def quoted_identifier(name, convert=true) convert ? "`#{convert_aliased_col_to_real_col(name)}`" : "`#{name}`" end def select_clause_methods super end def select_limit_sql(sql) super(sql) end end end
Version data entries
28 entries across 28 versions & 1 rubygems