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

Version Path
challah-0.6.2 vendor/bundle/gems/sqlite3-1.3.5/test/test_database_readonly.rb
challah-0.6.1 vendor/bundle/gems/sqlite3-1.3.5/test/test_database_readonly.rb
challah-0.6.0 vendor/bundle/gems/sqlite3-1.3.5/test/test_database_readonly.rb
challah-0.5.4 vendor/bundle/gems/sqlite3-1.3.5/test/test_database_readonly.rb
challah-0.5.3 vendor/bundle/gems/sqlite3-1.3.5/test/test_database_readonly.rb
challah-0.5.2 vendor/bundle/gems/sqlite3-1.3.5/test/test_database_readonly.rb
challah-0.5.1 vendor/bundle/gems/sqlite3-1.3.5/test/test_database_readonly.rb
radiant-1.0.0 ruby-debug/ruby/1.8/gems/sqlite3-1.3.4/test/test_database_readonly.rb
challah-0.5.0 vendor/bundle/gems/sqlite3-1.3.5/test/test_database_readonly.rb
challah-0.4.1 vendor/bundle/gems/sqlite3-1.3.5/test/test_database_readonly.rb
challah-0.4.0 vendor/bundle/gems/sqlite3-1.3.5/test/test_database_readonly.rb
challah-0.3.5 vendor/bundle/gems/sqlite3-1.3.5/test/test_database_readonly.rb
challah-0.3.4 vendor/bundle/gems/sqlite3-1.3.5/test/test_database_readonly.rb
challah-0.3.3 vendor/bundle/gems/sqlite3-1.3.5/test/test_database_readonly.rb
challah-0.3.2 vendor/bundle/gems/sqlite3-1.3.5/test/test_database_readonly.rb
challah-0.3.1 vendor/bundle/gems/sqlite3-1.3.5/test/test_database_readonly.rb
challah-0.3.0 vendor/bundle/gems/sqlite3-1.3.5/test/test_database_readonly.rb
challah-0.2.1 vendor/bundle/gems/sqlite3-1.3.5/test/test_database_readonly.rb
challah-0.2.0 vendor/bundle/gems/sqlite3-1.3.5/test/test_database_readonly.rb
sqlite3-1.3.5-x86-mswin32-60 test/test_database_readonly.rb