Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OHR Support
Manage
Activity
Members
Labels
Plan
Issues
97
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
OHR Support
Commits
7b3a2047
Commit
7b3a2047
authored
13 years ago
by
Holger Just
Browse files
Options
Downloads
Patches
Plain Diff
Whitespace fixes
parent
705c0db0
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/chili_project/database.rb
+1
-1
1 addition, 1 deletion
lib/chili_project/database.rb
test/unit/lib/chili_project/database_test.rb
+5
-5
5 additions, 5 deletions
test/unit/lib/chili_project/database_test.rb
with
6 additions
and
6 deletions
lib/chili_project/database.rb
+
1
−
1
View file @
7b3a2047
...
@@ -46,7 +46,7 @@ module ChiliProject
...
@@ -46,7 +46,7 @@ module ChiliProject
self
.
adapter_name
=~
regex
self
.
adapter_name
=~
regex
}[
0
]
}[
0
]
end
end
# Provide helper methods to quickly check the database type
# Provide helper methods to quickly check the database type
# ChiliProject::Database.mysql? returns true, if we have a MySQL DB
# ChiliProject::Database.mysql? returns true, if we have a MySQL DB
supported_adapters
.
keys
.
each
do
|
adapter
|
supported_adapters
.
keys
.
each
do
|
adapter
|
...
...
This diff is collapsed.
Click to expand it.
test/unit/lib/chili_project/database_test.rb
+
5
−
5
View file @
7b3a2047
...
@@ -22,7 +22,7 @@ class ChiliProject::DatabaseTest < ActiveSupport::TestCase
...
@@ -22,7 +22,7 @@ class ChiliProject::DatabaseTest < ActiveSupport::TestCase
ChiliProject
::
Database
.
stubs
(
:adapter_name
).
returns
"SQLite"
ChiliProject
::
Database
.
stubs
(
:adapter_name
).
returns
"SQLite"
SQLite3
::
Driver
::
Native
::
API
.
stubs
(
:sqlite3_libversion
).
returns
"3.6.12"
SQLite3
::
Driver
::
Native
::
API
.
stubs
(
:sqlite3_libversion
).
returns
"3.6.12"
end
end
should
"return the correct identifier"
do
should
"return the correct identifier"
do
assert_equal
:sqlite
,
ChiliProject
::
Database
.
name
assert_equal
:sqlite
,
ChiliProject
::
Database
.
name
end
end
...
@@ -32,19 +32,19 @@ class ChiliProject::DatabaseTest < ActiveSupport::TestCase
...
@@ -32,19 +32,19 @@ class ChiliProject::DatabaseTest < ActiveSupport::TestCase
assert_equal
false
,
ChiliProject
::
Database
.
postgresql?
assert_equal
false
,
ChiliProject
::
Database
.
postgresql?
assert_equal
true
,
ChiliProject
::
Database
.
sqlite?
assert_equal
true
,
ChiliProject
::
Database
.
sqlite?
end
end
should
"return a version string"
do
should
"return a version string"
do
assert_equal
"3.6.12"
,
ChiliProject
::
Database
.
version
assert_equal
"3.6.12"
,
ChiliProject
::
Database
.
version
end
end
should
"return long version string for raw==true"
do
should
"return long version string for raw==true"
do
ChiliProject
::
Database
.
stubs
(
:adapter_name
).
returns
"PostgreSQL"
ChiliProject
::
Database
.
stubs
(
:adapter_name
).
returns
"PostgreSQL"
raw_version
=
"PostgreSQL 8.3.11 on x86_64-pc-linux-gnu, compiled by GCC gcc-4.3.real (Debian 4.3.2-1.1) 4.3.2"
raw_version
=
"PostgreSQL 8.3.11 on x86_64-pc-linux-gnu, compiled by GCC gcc-4.3.real (Debian 4.3.2-1.1) 4.3.2"
ActiveRecord
::
Base
.
connection
.
stubs
(
:select_value
).
returns
raw_version
ActiveRecord
::
Base
.
connection
.
stubs
(
:select_value
).
returns
raw_version
assert_equal
"8.3.11"
,
ChiliProject
::
Database
.
version
assert_equal
"8.3.11"
,
ChiliProject
::
Database
.
version
assert_equal
raw_version
,
ChiliProject
::
Database
.
version
(
true
)
assert_equal
raw_version
,
ChiliProject
::
Database
.
version
(
true
)
end
end
end
end
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment