Sha256: a8f0455cdf830fc988985cac2c604ae1aea5bef80902c110d89fa8025e1910f1
Contents?: true
Size: 982 Bytes
Versions: 19
Compression:
Stored size: 982 Bytes
Contents
#encoding: utf-8 require File.expand_path(File.dirname(__FILE__) + '/spec_helper') describe "Db" do it "should be able to handle various encodings" do #I never got this test to actually fail... :-( require "knj/db" require "tmpdir" require "sqlite3" db_path = "#{Dir.tmpdir}/knjrbfw_test_sqlite3.sqlite3" db = Knj::Db.new( :type => "sqlite3", :path => db_path, :return_keys => "symbols", :index_append_table_name => true ) db.tables.create("test", { "columns" => [ {"name" => "id", "type" => "int", "autoincr" => true, "primarykey" => true}, {"name" => "text", "type" => "varchar"} ] }) begin cont = File.read("#{File.dirname(__FILE__)}/db_spec_encoding_test_file.txt") cont.force_encoding("ASCII-8BIT") db.insert("test", { "text" => cont }) ensure File.unlink(db_path) if File.exists?(db_path) end end end
Version data entries
19 entries across 19 versions & 1 rubygems