Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
OHR Support
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
97
Issues
97
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
OHR Support
Commits
35a38086
Commit
35a38086
authored
May 22, 2011
by
Holger Just
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[
#112
] Fix tests for jruby
parent
18247a6c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
database.rb
lib/chili_project/database.rb
+1
-1
database_test.rb
test/unit/lib/chili_project/database_test.rb
+2
-2
No files found.
lib/chili_project/database.rb
View file @
35a38086
...
...
@@ -66,7 +66,7 @@ module ChiliProject
version
=
ActiveRecord
::
Base
.
connection
.
select_value
(
'SELECT version()'
)
raw
?
version
:
version
.
match
(
/^PostgreSQL (\S+)/i
)[
1
]
when
:sqlite
if
RUBY_ENGINE
==
'jruby'
if
Object
.
const_defined?
(
'RUBY_ENGINE'
)
&&
::
RUBY_ENGINE
==
'jruby'
Jdbc
::
SQLite3
::
VERSION
else
if
SQLite3
.
const_defined?
'SQLITE_VERSION'
...
...
test/unit/lib/chili_project/database_test.rb
View file @
35a38086
...
...
@@ -36,7 +36,7 @@ class ChiliProject::DatabaseTest < ActiveSupport::TestCase
begin
ChiliProject
::
Database
.
stubs
(
:adapter_name
).
returns
"SQLite"
if
RUBY_ENGINE
==
'jruby'
if
Object
.
const_defined?
(
'RUBY_ENGINE'
)
&&
::
RUBY_ENGINE
==
'jruby'
# If we have the SQLite3 gem installed, save the old constant
if
Object
.
const_defined?
(
'Jdbc'
)
&&
Jdbc
::
SQLite3
.
const_defined?
(
'SQLite3'
)
sqlite3_version
=
Jdbc
::
SQLite3
::
VERSION
...
...
@@ -70,7 +70,7 @@ class ChiliProject::DatabaseTest < ActiveSupport::TestCase
assert_equal
"1.2.3"
,
ChiliProject
::
Database
.
version
(
true
)
ensure
# Clean up after us
if
RUBY_ENGINE
==
'jruby'
if
Object
.
const_defined?
(
'RUBY_ENGINE'
)
&&
::
RUBY_ENGINE
==
'jruby'
if
created_module
Jdbc
.
instance_eval
{
remove_const
'SQLite3'
}
elsif
sqlite3_version
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment