rubyfb 0.5.7 → 0.5.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/Connection.rb CHANGED
@@ -4,5 +4,30 @@ module Rubyfb
4
4
  def prepare_call(procedure_name)
5
5
  Rubyfb::ProcedureCall.new(self, procedure_name)
6
6
  end
7
+
8
+ def force_encoding(fb_str, sqlsubtype)
9
+ fb_str
10
+ end
11
+ private
12
+ def init_m17n
13
+ return unless String.method_defined?(:force_encoding)
14
+
15
+ @charset_map= Hash.new(Rubyfb::Options.charset_name_map.default)
16
+ start_transaction do |tr|
17
+ execute("SELECT RDB$CHARACTER_SET_NAME, RDB$CHARACTER_SET_ID FROM RDB$CHARACTER_SETS", tr) do |row|
18
+ @charset_map[row['RDB$CHARACTER_SET_ID']]=Rubyfb::Options.charset_name_map[row['RDB$CHARACTER_SET_NAME'].strip]
19
+ end
20
+ end
21
+ instance_eval do
22
+ def force_encoding(fb_str, sqlsubtype)
23
+ fb_str.tap do |s|
24
+ s.force_encoding(@charset_map[sqlsubtype])
25
+ end
26
+ end
27
+ end
28
+ end
7
29
  end
8
30
  end
31
+
32
+
33
+
@@ -3,7 +3,11 @@ require 'active_record/connection_adapters/abstract_adapter'
3
3
  require 'active_support/core_ext/kernel/requires'
4
4
 
5
5
  if defined?(Arel) then
6
- require 'arel/visitors/rubyfb'
6
+ if Rubyfb::Options.fb15_compat
7
+ require 'arel/visitors/rubyfb_15compat'
8
+ else
9
+ require 'arel/visitors/rubyfb'
10
+ end
7
11
  end
8
12
 
9
13
  module Rubyfb # :nodoc: all
@@ -0,0 +1,25 @@
1
+ module Arel
2
+ module Visitors
3
+ class RubyFB_15Compat < Arel::Visitors::ToSql
4
+ Arel::Visitors::VISITORS['rubyfb'] = Arel::Visitors::RubyFB_15Compat
5
+ private
6
+ def visit_Arel_Nodes_SelectStatement o
7
+ limit = o.limit; o.limit = nil;
8
+ offset = o.offset; o.offset = nil;
9
+ super.tap do |s|
10
+ if limit || offset
11
+ s.gsub!(/^\s*select/i, "SELECT #{fb_limit(limit)} #{fb_offset(offset)} ")
12
+ end
13
+ end
14
+ end
15
+
16
+ def fb_limit limit
17
+ "first #{limit.expr}" if limit
18
+ end
19
+
20
+ def fb_offset offset
21
+ "skip #{offset.expr}" if offset
22
+ end
23
+ end
24
+ end
25
+ end
data/lib/rubyfb.rb CHANGED
@@ -1,3 +1,4 @@
1
+ require 'rubyfb_options'
1
2
  require 'rubyfb_lib'
2
3
  require 'SQLType'
3
4
  require 'ProcedureCall'
data/lib/rubyfb_lib.so CHANGED
Binary file
@@ -0,0 +1,51 @@
1
+ module Rubyfb
2
+ class Options
3
+ @@fb15_compat = false
4
+ def self.fb15_compat
5
+ @@fb15_compat
6
+ end
7
+ def self.fb15_compat=(value)
8
+ @@fb15_compat = value
9
+ end
10
+ @@charset_name_map = {
11
+ 'BIG_5' => 'Big5',
12
+ 'GB_2312' => 'GB2312',
13
+ 'GBK' => 'GBK',
14
+ 'KOI8U' => 'KOI8-U',
15
+ 'ISO8859_1' => 'ISO-8859-1',
16
+ 'ISO8859_2' => 'ISO-8859-2',
17
+ 'ISO8859_3' => 'ISO-8859-3',
18
+ 'ISO8859_4' => 'ISO-8859-4',
19
+ 'ISO8859_5' => 'ISO-8859-5',
20
+ 'ISO8859_6' => 'ISO-8859-6',
21
+ 'ISO8859_7' => 'ISO-8859-7',
22
+ 'ISO8859_8' => 'ISO-8859-8',
23
+ 'ISO8859_9' => 'ISO-8859-9',
24
+ 'ISO8859_10' => 'ISO-8859-10',
25
+ 'ISO8859_11' => 'ISO-8859-11',
26
+ 'ISO8859_12' => 'ISO-8859-12',
27
+ 'ISO8859_13' => 'ISO-8859-13',
28
+ 'SJIS' => 'Windows-31J',
29
+ 'UTF8' => 'UTF-8',
30
+ 'UNICODE_FSS' => 'UTF-8',
31
+ 'DOS866' => 'IBM866',
32
+ 'WIN874' => 'Windows-874',
33
+ 'WIN1250' => 'Windows-1250',
34
+ 'WIN1251' => 'Windows-1251',
35
+ 'WIN1252' => 'Windows-1252',
36
+ 'WIN1253' => 'Windows-1253',
37
+ 'WIN1254' => 'Windows-1254',
38
+ 'WIN1255' => 'Windows-1255',
39
+ 'WIN1256' => 'Windows-1256',
40
+ 'WIN1257' => 'Windows-1257',
41
+ 'WIN1258' => 'Windows-1258'
42
+ }.tap do |h|
43
+ h.default = 'ASCII-8BIT'
44
+ end
45
+
46
+ def self.charset_name_map
47
+ @@charset_name_map
48
+ end
49
+ end
50
+ end
51
+
data/rubyfb.gemspec CHANGED
@@ -2,16 +2,16 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{rubyfb}
5
- s.version = "0.5.7"
5
+ s.version = "0.5.8"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["George Georgiev"]
9
- s.date = %q{2011-02-14}
9
+ s.date = %q{2011-04-03}
10
10
  s.description = %q{Firebird SQL access library}
11
11
  s.email = %q{georgiev@heatbs.com}
12
12
  s.extensions = ["ext/extconf.rb"]
13
- s.extra_rdoc_files = ["CHANGELOG", "LICENSE", "README", "examples/example01.rb", "ext/extconf.rb", "lib/Connection.rb", "lib/ProcedureCall.rb", "lib/SQLType.rb", "lib/rubyfb.rb", "lib/src.rb"]
14
- s.files = ["CHANGELOG", "LICENSE", "Manifest", "README", "Rakefile", "examples/example01.rb", "ext/AddUser.c", "ext/AddUser.h", "ext/Backup.c", "ext/Backup.h", "ext/Blob.c", "ext/Blob.h", "ext/Common.c", "ext/Common.h", "ext/Connection.c", "ext/Connection.h", "ext/DataArea.c", "ext/DataArea.h", "ext/Database.c", "ext/Database.h", "ext/FireRuby.c", "ext/FireRuby.h", "ext/FireRubyException.c", "ext/FireRubyException.h", "ext/Generator.c", "ext/Generator.h", "ext/RemoveUser.c", "ext/RemoveUser.h", "ext/Restore.c", "ext/Restore.h", "ext/ResultSet.c", "ext/ResultSet.h", "ext/Row.c", "ext/Row.h", "ext/ServiceManager.c", "ext/ServiceManager.h", "ext/Services.c", "ext/Services.h", "ext/Statement.c", "ext/Statement.h", "ext/Transaction.c", "ext/Transaction.h", "ext/TypeMap.c", "ext/TypeMap.h", "ext/extconf.rb", "ext/rfbint.h", "ext/rfbsleep.h", "lib/Connection.rb", "lib/ProcedureCall.rb", "lib/SQLType.rb", "lib/active_record/connection_adapters/rubyfb_adapter.rb", "lib/arel/visitors/rubyfb.rb", "lib/mkdoc", "lib/rubyfb.rb", "lib/rubyfb_lib.so", "lib/src.rb", "mswin32fb/fbclient_mingw.def", "mswin32fb/fbclient_mingw.lib", "mswin32fb/fbclient_ms.lib", "mswin32fb/ibase.h", "mswin32fb/iberror.h", "test/AddRemoveUserTest.rb", "test/BackupRestoreTest.rb", "test/BlobTest.rb", "test/CharacterSetTest.rb", "test/ConnectionTest.rb", "test/DDLTest.rb", "test/DatabaseTest.rb", "test/GeneratorTest.rb", "test/KeyTest.rb", "test/ResultSetTest.rb", "test/RoleTest.rb", "test/RowCountTest.rb", "test/RowTest.rb", "test/SQLTest.rb", "test/SQLTypeTest.rb", "test/ServiceManagerTest.rb", "test/StatementTest.rb", "test/TestSetup.rb", "test/TransactionTest.rb", "test/TypeTest.rb", "rubyfb.gemspec"]
13
+ s.extra_rdoc_files = ["CHANGELOG", "LICENSE", "README", "examples/example01.rb", "ext/extconf.rb", "lib/Connection.rb", "lib/ProcedureCall.rb", "lib/SQLType.rb", "lib/rubyfb.rb", "lib/rubyfb_options.rb", "lib/src.rb"]
14
+ s.files = ["CHANGELOG", "LICENSE", "Manifest", "README", "Rakefile", "examples/example01.rb", "ext/AddUser.c", "ext/AddUser.h", "ext/Backup.c", "ext/Backup.h", "ext/Blob.c", "ext/Blob.h", "ext/Common.c", "ext/Common.h", "ext/Connection.c", "ext/Connection.h", "ext/DataArea.c", "ext/DataArea.h", "ext/Database.c", "ext/Database.h", "ext/FireRuby.c", "ext/FireRuby.h", "ext/FireRubyException.c", "ext/FireRubyException.h", "ext/Generator.c", "ext/Generator.h", "ext/RemoveUser.c", "ext/RemoveUser.h", "ext/Restore.c", "ext/Restore.h", "ext/ResultSet.c", "ext/ResultSet.h", "ext/Row.c", "ext/Row.h", "ext/ServiceManager.c", "ext/ServiceManager.h", "ext/Services.c", "ext/Services.h", "ext/Statement.c", "ext/Statement.h", "ext/Transaction.c", "ext/Transaction.h", "ext/TypeMap.c", "ext/TypeMap.h", "ext/extconf.rb", "ext/rfbint.h", "ext/rfbsleep.h", "ext/uncrustify.cfg", "lib/Connection.rb", "lib/ProcedureCall.rb", "lib/SQLType.rb", "lib/active_record/connection_adapters/rubyfb_adapter.rb", "lib/arel/visitors/rubyfb.rb", "lib/arel/visitors/rubyfb_15compat.rb", "lib/mkdoc", "lib/rubyfb.rb", "lib/rubyfb_lib.so", "lib/rubyfb_options.rb", "lib/src.rb", "mswin32fb/fbclient_mingw.def", "mswin32fb/fbclient_mingw.lib", "mswin32fb/fbclient_ms.lib", "mswin32fb/ibase.h", "mswin32fb/iberror.h", "test/AddRemoveUserTest.rb", "test/BackupRestoreTest.rb", "test/BlobTest.rb", "test/CharacterSetTest.rb", "test/ConnectionTest.rb", "test/DDLTest.rb", "test/DatabaseTest.rb", "test/GeneratorTest.rb", "test/KeyTest.rb", "test/ResultSetTest.rb", "test/RoleTest.rb", "test/RowCountTest.rb", "test/RowTest.rb", "test/SQLTest.rb", "test/SQLTypeTest.rb", "test/ServiceManagerTest.rb", "test/StatementTest.rb", "test/TestSetup.rb", "test/TransactionTest.rb", "test/TypeTest.rb", "rubyfb.gemspec"]
15
15
  s.homepage = %q{http://rubyforge.org/projects/rubyfb}
16
16
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Rubyfb", "--main", "README"]
17
17
  s.require_paths = ["lib", "ext"]
@@ -8,8 +8,7 @@ require 'rubyfb'
8
8
  include Rubyfb
9
9
 
10
10
  class AddRemoveUserTest < Test::Unit::TestCase
11
- CURDIR = "#{Dir.getwd}"
12
- DB_FILE = "#{CURDIR}#{File::SEPARATOR}add_remove_user_unit_test.fdb"
11
+ DB_FILE = File.join(DB_DIR, "add_remove_user_unit_test.fdb")
13
12
 
14
13
  def setup
15
14
  puts "#{self.class.name} started." if TEST_LOGGING
@@ -8,20 +8,27 @@ require 'rubyfb'
8
8
  include Rubyfb
9
9
 
10
10
  class BackupRestoreTest < Test::Unit::TestCase
11
- CURDIR = "#{Dir.getwd}"
12
- DB_FILE = "#{CURDIR}#{File::SEPARATOR}backup_restore_unit_test.fdb"
13
- BACKUP_FILE = "#{CURDIR}#{File::SEPARATOR}database.bak"
11
+ DB_FILE = File.join(DB_DIR, "backup_restore_unit_test.fdb")
12
+ BACKUP_FILE = File.join(DB_DIR, "database.bak")
13
+
14
+ def cleanup
15
+ # Remove existing database files.
16
+ if File.exist?(DB_FILE)
17
+ db = Database.new(DB_FILE).drop(DB_USER_NAME, DB_PASSWORD)
18
+ end
19
+
20
+ if File.exist?(BACKUP_FILE)
21
+ begin
22
+ File.delete(BACKUP_FILE)
23
+ rescue
24
+ # ignore file permissions may cause this
25
+ end
26
+ end
27
+ end
14
28
 
15
29
  def setup
16
30
  puts "#{self.class.name} started." if TEST_LOGGING
17
- # Remove existing database files.
18
- if File.exist?(DB_FILE)
19
- db = Database.new(DB_FILE).drop(DB_USER_NAME, DB_PASSWORD)
20
- end
21
-
22
- if File.exist?(BACKUP_FILE)
23
- File.delete(BACKUP_FILE)
24
- end
31
+ cleanup
25
32
 
26
33
  # Create and populate the database files.
27
34
  @database = Database.create(DB_FILE, DB_USER_NAME, DB_PASSWORD)
@@ -35,17 +42,10 @@ class BackupRestoreTest < Test::Unit::TestCase
35
42
  end
36
43
  end
37
44
 
38
- def teardown
39
- # Remove existing database files.
40
- if File.exist?(DB_FILE)
41
- db = Database.new(DB_FILE).drop(DB_USER_NAME, DB_PASSWORD)
42
- end
43
-
44
- if File.exist?(BACKUP_FILE)
45
- File.delete(BACKUP_FILE)
46
- end
47
- puts "#{self.class.name} finished." if TEST_LOGGING
48
- end
45
+ def teardown
46
+ cleanup
47
+ puts "#{self.class.name} finished." if TEST_LOGGING
48
+ end
49
49
 
50
50
  def test01
51
51
  sm = ServiceManager.new('localhost')
data/test/BlobTest.rb CHANGED
@@ -8,9 +8,8 @@ require 'rubyfb'
8
8
  include Rubyfb
9
9
 
10
10
  class BlobTest < Test::Unit::TestCase
11
- CURDIR = "#{Dir.getwd}"
12
- DB_FILE = "#{CURDIR}#{File::SEPARATOR}blob_unit_test.fdb"
13
- TXT_FILE = "#{CURDIR}#{File::SEPARATOR}data.txt"
11
+ DB_FILE = File.join(DB_DIR, "blob_unit_test.fdb")
12
+ TXT_FILE = File.join(DB_DIR, "data.txt")
14
13
  DATA = "aasdfjakhdsfljkashdfslfhaslhasyhfawyufalwuhlhsdlkfhasljlkshflalksjhasjhalsjhdf\nasdflkajshdfjkahsdfjajdfalsdfasdf\nasdfasdfasdkljfhajdfhkjasdfagdsflalkjfgagsdflasdf\nasdfasdfasdf"
15
14
 
16
15
  def setup
@@ -9,56 +9,51 @@ require 'rubyfb'
9
9
  include Rubyfb
10
10
 
11
11
  class CharacterSetTest < Test::Unit::TestCase
12
- CURDIR = "#{Dir.getwd}"
13
- DB_FILE = "#{CURDIR}#{File::SEPARATOR}cxnarset_unit_test.fdb"
14
- CHAR_SET = 'WIN1251'
15
-
16
- def setup
17
- puts "#{self.class.name} started." if TEST_LOGGING
18
- if File::exist?(DB_FILE)
19
- Database.new(DB_FILE).drop(DB_USER_NAME, DB_PASSWORD)
12
+ DB_FILE = File.join(DB_DIR, "cxnarset_unit_test.fdb")
13
+ CHAR_SET = 'WIN1251'
14
+
15
+ def setup
16
+ puts "#{self.class.name} started." if TEST_LOGGING
17
+ if File::exist?(DB_FILE)
18
+ Database.new(DB_FILE).drop(DB_USER_NAME, DB_PASSWORD)
19
+ end
20
+ @database = Database.create(DB_FILE, DB_USER_NAME, DB_PASSWORD, 1024, CHAR_SET)
21
+ end
22
+
23
+ def teardown
24
+ if File::exist?(DB_FILE)
25
+ Database.new(DB_FILE).drop(DB_USER_NAME, DB_PASSWORD)
26
+ end
27
+ puts "#{self.class.name} finished." if TEST_LOGGING
28
+ end
29
+
30
+ def test01
31
+ db = Database.new(DB_FILE, CHAR_SET)
32
+
33
+ assert(db.character_set = CHAR_SET)
34
+
35
+ db.character_set = 'ASCII'
36
+ assert(db.character_set == 'ASCII')
37
+ end
38
+
39
+ def test02
40
+ db = Database.new(DB_FILE, CHAR_SET)
41
+
42
+ win1251_str = '���������'
43
+ db.connect("SYSDBA", "masterkey") do |cxn|
44
+ cxn.start_transaction do |tr|
45
+ cxn.execute("CREATE TABLE SAMPLE_TABLE(SAMPLE_FIELD VARCHAR(100) CHARACTER SET UTF8)", tr)
46
+ end
47
+ cxn.start_transaction do |tr|
48
+ cxn.execute("INSERT INTO SAMPLE_TABLE VALUES ('#{win1251_str}')", tr)
49
+ row_count = 0
50
+ cxn.execute("SELECT * FROM SAMPLE_TABLE WHERE SAMPLE_FIELD = '#{win1251_str}'", tr) do |row|
51
+ assert(row['SAMPLE_FIELD']==win1251_str, "Database encoding failed")
52
+ row_count += 1
53
+ end
54
+ assert(1==row_count)
20
55
  end
21
-
22
- @database = Database.create(DB_FILE, DB_USER_NAME, DB_PASSWORD, 1024,
23
- CHAR_SET)
24
- end
25
-
26
- def teardown
27
- if File::exist?(DB_FILE)
28
- Database.new(DB_FILE).drop(DB_USER_NAME, DB_PASSWORD)
29
- end
30
- puts "#{self.class.name} finished." if TEST_LOGGING
31
- end
32
-
33
- def test01
34
- db = Database.new(DB_FILE, CHAR_SET)
35
-
36
- assert(db.character_set = CHAR_SET)
37
-
38
- db.character_set = 'ASCII'
39
- assert(db.character_set == 'ASCII')
40
- end
41
-
42
- def test02
43
- db = Database.new(DB_FILE, CHAR_SET)
44
-
45
- begin
46
- win1251_str = '���������'
47
- db.connect("SYSDBA", "masterkey") do |cxn|
48
- cxn.start_transaction do |tr|
49
- cxn.execute("CREATE TABLE SAMPLE_TABLE(SAMPLE_FIELD VARCHAR(100))",tr)
50
- end
51
- cxn.start_transaction do |tr|
52
- cxn.execute("INSERT INTO SAMPLE_TABLE VALUES ('#{win1251_str}')",tr)
53
- cxn.execute("SELECT * FROM SAMPLE_TABLE WHERE SAMPLE_FIELD = "\
54
- "'#{win1251_str}'",tr) do |row|
55
- # here we have an exception:
56
- some_var = row['SAMPLE_FIELD']
57
- end
58
- end
59
- end
60
- # rescue => error
61
- # assert("Character set unit test failure.", false)
62
- end
63
- end
56
+ end
57
+ end
64
58
  end
59
+
@@ -8,8 +8,7 @@ require 'rubyfb'
8
8
  include Rubyfb
9
9
 
10
10
  class ConnectionTest < Test::Unit::TestCase
11
- CURDIR = "#{Dir.getwd}"
12
- DB_FILE = "#{CURDIR}#{File::SEPARATOR}con_unit_test.fdb"
11
+ DB_FILE = File.join(DB_DIR, "con_unit_test.fdb")
13
12
 
14
13
  def setup
15
14
  puts "#{self.class.name} started." if TEST_LOGGING
data/test/DDLTest.rb CHANGED
@@ -8,8 +8,7 @@ require 'rubyfb'
8
8
  include Rubyfb
9
9
 
10
10
  class DDLTest < Test::Unit::TestCase
11
- CURDIR = "#{Dir.getwd}"
12
- DB_FILE = "#{CURDIR}#{File::SEPARATOR}ddl_unit_test.fdb"
11
+ DB_FILE = File.join(DB_DIR, "ddl_unit_test.fdb")
13
12
 
14
13
  def setup
15
14
  puts "#{self.class.name} started." if TEST_LOGGING
data/test/DatabaseTest.rb CHANGED
@@ -8,9 +8,8 @@ require 'rubyfb'
8
8
  include Rubyfb
9
9
 
10
10
  class DatabaseTest < Test::Unit::TestCase
11
- CURDIR = "#{Dir.getwd}"
12
- DB_FILE = "#{CURDIR}#{File::SEPARATOR}db_unit_test.fdb"
13
- CREATE_FILE = "#{CURDIR}#{File::SEPARATOR}db_create_test.fdb"
11
+ DB_FILE = File.join(DB_DIR, "db_unit_test.fdb")
12
+ CREATE_FILE = File.join(DB_DIR, "db_create_test.fdb")
14
13
 
15
14
  def setup
16
15
  puts "#{self.class.name} started." if TEST_LOGGING
@@ -8,8 +8,7 @@ require 'rubyfb'
8
8
  include Rubyfb
9
9
 
10
10
  class GeneratorTest < Test::Unit::TestCase
11
- CURDIR = "#{Dir.getwd}"
12
- DB_FILE = "#{CURDIR}#{File::SEPARATOR}generator_unit_test.fdb"
11
+ DB_FILE = File.join(DB_DIR, "generator_unit_test.fdb")
13
12
 
14
13
  def setup
15
14
  puts "#{self.class.name} started." if TEST_LOGGING
data/test/KeyTest.rb CHANGED
@@ -8,8 +8,7 @@ require 'rubyfb'
8
8
  include Rubyfb
9
9
 
10
10
  class KeyTest < Test::Unit::TestCase
11
- CURDIR = "#{Dir.getwd}"
12
- DB_FILE = "#{CURDIR}#{File::SEPARATOR}key_unit_test.fdb"
11
+ DB_FILE = File.join(DB_DIR, "key_unit_test.fdb")
13
12
 
14
13
  def setup
15
14
  puts "#{self.class.name} started." if TEST_LOGGING
@@ -8,8 +8,7 @@ require 'rubyfb'
8
8
  include Rubyfb
9
9
 
10
10
  class ResultSetTest < Test::Unit::TestCase
11
- CURDIR = "#{Dir.getwd}"
12
- DB_FILE = "#{CURDIR}#{File::SEPARATOR}result_set_unit_test.fdb"
11
+ DB_FILE = File.join(DB_DIR, "result_set_unit_test.fdb")
13
12
 
14
13
  def setup
15
14
  puts "#{self.class.name} started." if TEST_LOGGING
@@ -172,4 +171,17 @@ class ResultSetTest < Test::Unit::TestCase
172
171
  ensure
173
172
  results.close if results
174
173
  end
174
+
175
+ def test06
176
+ results = @transactions.first.execute(<<-EOSQL)
177
+ SELECT * FROM RDB$DATABASE WHERE 1=0
178
+ EOSQL
179
+
180
+ assert_nil(results.fetch,
181
+ 'Initial #fetch of empty result set was not nil')
182
+ assert(results.exhausted?,
183
+ 'Completely fetched ResultSet was not #exhausted?')
184
+ assert_nil(results.fetch,
185
+ '#fetch after exhaustion was not nil')
186
+ end
175
187
  end
data/test/RoleTest.rb CHANGED
@@ -8,8 +8,7 @@ require 'rubyfb'
8
8
  include Rubyfb
9
9
 
10
10
  class RoleTest < Test::Unit::TestCase
11
- CURDIR = "#{Dir.getwd}"
12
- DB_FILE = "#{CURDIR}#{File::SEPARATOR}role_unit_test.fdb"
11
+ DB_FILE = File.join(DB_DIR, "role_unit_test.fdb")
13
12
 
14
13
  def setup
15
14
  puts "#{self.class.name} started." if TEST_LOGGING
data/test/RowCountTest.rb CHANGED
@@ -8,8 +8,7 @@ require 'rubyfb'
8
8
  include Rubyfb
9
9
 
10
10
  class RowCountTest < Test::Unit::TestCase
11
- CURDIR = "#{Dir.getwd}"
12
- DB_FILE = "#{CURDIR}#{File::SEPARATOR}row_count_test.fdb"
11
+ DB_FILE = File.join(DB_DIR, "row_count_test.fdb")
13
12
 
14
13
  def setup
15
14
  puts "#{self.class.name} started." if TEST_LOGGING