Sha256: a8517939675151c50969fa2da10affc25faea094c3a09b52e23dc11142f6c353

Contents?: true

Size: 975 Bytes

Versions: 9

Compression:

Stored size: 975 Bytes

Contents

require 'rubygems'
require 'bundler/setup'

$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))

require 'quebert'
require 'quebert/logging'
require 'logger'

include Quebert
Quebert.config.logger = Logger.new('/dev/null') # Shhh...

def clean_file(path, contents=nil, &block)
  FileUtils.remove_entry(path) if File.exists?(path)
  FileUtils.mkdir_p(File.dirname(path))
  begin
    File.open(path, 'w'){|f| f.write(contents == :empty ? nil : contents) } unless contents.nil?
    block.call
  ensure
    FileUtils.remove_entry(path) if File.exists?(path) and path != './'  # Yeah! This has happened before :(
  end
end

def redefine_constant(obj, const, value)
  obj.send(:remove_const, const) if obj.const_defined?(const)
  obj.const_set(const, value)
end

Dir[File.join(File.dirname(__FILE__), 'support/*.rb')].each {|file| require file }

Quebert.serializers.register 'ActiveRecord::Base', Serializer::ActiveRecord

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
quebert-3.3.0 spec/spec_helper.rb
quebert-3.2.1 spec/spec_helper.rb
quebert-3.2.0 spec/spec_helper.rb
quebert-3.0.3 spec/spec_helper.rb
quebert-3.0.2 spec/spec_helper.rb
quebert-3.0.1 spec/spec_helper.rb
quebert-3.0.0 spec/spec_helper.rb
quebert-2.0.4 spec/spec_helper.rb
quebert-2.0.3 spec/spec_helper.rb