Sha256: 4456c2bb61b90e5e657d1ae91e16633298720a0a9fcea972b4386e445596c807

Contents?: true

Size: 1 KB

Versions: 1

Compression:

Stored size: 1 KB

Contents

require 'rubygems'
require 'test/unit'
require 'mocha'

require 'curly_mustache'

# This has to go before the model definitions or class_inheritable_accessor won't inherit.
adapter = ENV["ADAPTER"] || ENV["adapter"] || "memcached"
configs = YAML.load(File.open(File.dirname(__FILE__)+"/adapters.yml"){ |f| f.read })
CurlyMustache::Base.establish_connection(configs[adapter].merge(:adapter => adapter))

# This also has to go before the model definitions or class_inheritable_accessor won't inherit.
class CurlyMustache::Base
  if connection.adapter_name == :cassandra
    def send_attributes(attributes)
      attributes.inject({}) do |memo, (k, v)|
        memo[k] = String(v)
        memo
      end
    end
  end
end

# Load model definitions.
Dir.glob(File.dirname(__FILE__) + "/models/*").each{ |file_name| require file_name }

class ActiveSupport::TestCase
  
  def disable_tests
    methods.select{ |method| method =~ /^test_/ }.each do |method|
      self.class.send(:define_method, method){ nil }
    end
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
curly_mustache-0.1.0 test/test_helper.rb