Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

* Remove mysql support.

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

0 comments on commit e8c0841

Please sign in to comment.
Something went wrong with that request. Please try again.