Sha256: 584f8a438df2eb386719dc5833b1c990ca551e45f593418d9a2836c0a0eea38a
Contents?: true
Size: 792 Bytes
Versions: 33
Compression:
Stored size: 792 Bytes
Contents
require 'helper' module SQLite3 class TestDatabaseReadonly < Test::Unit::TestCase def setup File.unlink 'test-readonly.db' if File.exists?('test-readonly.db') @db = SQLite3::Database.new('test-readonly.db') @db.execute("CREATE TABLE foos (id integer)") @db.close end def teardown @db.close unless @db.closed? File.unlink 'test-readonly.db' end def test_open_readonly_database @db = SQLite3::Database.new('test-readonly.db', :readonly => true) assert @db.readonly? end def test_insert_readonly_database @db = SQLite3::Database.new('test-readonly.db', :readonly => true) assert_raise(SQLite3::ReadOnlyException) do @db.execute("INSERT INTO foos (id) VALUES (12)") end end end end
Version data entries
33 entries across 33 versions & 5 rubygems