Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

* Remove mysql support.

* Move ActiveRecordParser.init to test_parser.rb.
  • Loading branch information...
commit e8c084192319c8421f2d4e54d398a5f487f4b7b9 1 parent 3d599eb
Masao Mutoh authored
View
6 test/db/migrate.rb
@@ -2,10 +2,10 @@
create_table :topics do |t|
t.string :title, :author_name, :author_email_address
t.datetime :written_on
- t.date :last_read
t.timestamp :bonus_time
- t.boolean :approved
+ t.date :last_read
t.text :content
+ t.boolean :approved
t.integer :replies_count, :default=>0, :null=>false
t.integer :parent_id
t.string :type, :limit=>50
@@ -38,4 +38,4 @@
t.string :name,:city,:type, :limit=>100
t.timestamps
end
-end
+end
View
23 test/db/mysql.rb
@@ -1,23 +0,0 @@
-`mysqladmin -uroot -proot --force DROP activerecord_unittest`
-`mysqladmin -uroot -proot CREATE activerecord_unittest`
-
-#load the parser
-GetText::ActiveRecordParser.init(
- :adapter => "mysql",
- :username => "root",
- :password => "",
- :encoding => "utf8",
- :database => 'activerecord_unittest'
-)
-
-#e.g. Ubuntu: ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock
-ActiveRecord::Base.configurations = {"test" => {
- :adapter => "mysql",
- :username => "root",
- :password => "",
- :encoding => "utf8",
- :database => 'activerecord_unittest'
-}.with_indifferent_access}
-
-ActiveRecord::Base.logger = Logger.new('/dev/null')
-ActiveRecord::Base.establish_connection(:test)
View
10 test/db/sqlite.rb
@@ -1,14 +1,8 @@
-#setup the parser
-GetText::ActiveRecordParser.init(
- :adapter => "sqlite3",
- :database => ':memory:'
-)
-
#create a connection
ActiveRecord::Base.configurations = {"test" => {
:adapter => "sqlite3",
- :database => ":memory:",
+ :database => ":memory:"
}.with_indifferent_access}
ActiveRecord::Base.logger = Logger.new('/dev/null')
-ActiveRecord::Base.establish_connection(:test)
+ActiveRecord::Base.establish_connection(:test)
View
3  test/helper.rb
@@ -17,7 +17,6 @@
require 'gettext_activerecord'
# load database and setup parser
-require 'gettext_activerecord/parser'
require 'db/sqlite'
#require 'db/mysql'
require 'db/migrate'
@@ -53,4 +52,4 @@
# Make with_scope public for tests
class << ActiveRecord::Base
public :with_scope, :with_exclusive_scope
-end
+end
View
6 test/test_parser.rb
@@ -2,6 +2,12 @@
require 'gettext_activerecord/tools'
+#setup the parser
+GetText::ActiveRecordParser.init(
+ :adapter => 'sqlite3',
+ :database => ':memory:'
+)
+
class TestGetTextParser < Test::Unit::TestCase
def test_class
GetText::ActiveRecordParser.target?("models/topic.rb")
Please sign in to comment.
Something went wrong with that request. Please try again.