Sha256: 5d9a01882e6bba21c56ec91b50e347422c7e0cfa3061d8356c860fcac0517a59

Contents?: true

Size: 1.57 KB

Versions: 4

Compression:

Stored size: 1.57 KB

Contents

RAILS_ENV = "test"

require 'rubygems'

require 'lib/fossil'
require 'spec'
require 'rr'

unless defined?(DB_DEMO) #and defined?(DB_FOS)
  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 on non win platform ###################
unless RUBY_PLATFORM =~ /mswin32|linux/
  # if its not windows ( pervasive db ) .. modify the pervasive adapter to act more like mysql for certain things

  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
################                   end of special section                  ###################

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fossil-0.2.5 spec/spec_helper.rb
fossil-0.2.4 spec/spec_helper.rb
fossil-0.2.3 spec/spec_helper.rb
fossil-0.2.2 spec/spec_helper.rb