Browse files

specs fro activerecord wrapper

  • Loading branch information...
1 parent 970427c commit 522d95ff475096babdec0c8e1c9ca04936e12a13 @igrigorik committed Apr 13, 2010
Showing with 8 additions and 6 deletions.
  1. +7 −6 spec/activerecord_spec.rb
  2. +1 −0 spec/database.yml
View
13 spec/activerecord_spec.rb
@@ -11,17 +11,19 @@
ActiveRecord::Base.default_timezone = :utc
ActiveRecord::Base.logger = Logger.new(STDOUT)
ActiveRecord::Base.logger.level = Logger::INFO
-ActiveRecord::Base.pluralize_table_names = false
+ActiveRecord::Base.pluralize_table_names = true
ActiveRecord::Base.time_zone_aware_attributes = true
Time.zone = 'UTC'
+class Widget < ActiveRecord::Base; end;
+
describe "ActiveRecord Driver for EM-MySQLPlus" do
it "should establish AR connection" do
EventMachine.run {
Fiber.new {
ActiveRecord::Base.establish_connection
- result = ActiveRecord::Base.connection.query('select sleep(1)')
- p result
+ result = Widget.find_by_sql("select sleep(1)")
+ result.size.should == 1
EventMachine.stop
}.resume
@@ -35,7 +37,7 @@
3.times do |n|
Fiber.new {
ActiveRecord::Base.establish_connection
- results.push ActiveRecord::Base.connection.query('select sleep(1)')
+ results.push Widget.find_by_sql("select sleep(1)")
}.resume
end
@@ -45,5 +47,4 @@
}
}
end
-
-end
+end
View
1 spec/database.yml
@@ -1,4 +1,5 @@
test:
adapter: em_mysqlplus
database: widgets
+ user: root
pool: 3

0 comments on commit 522d95f

Please sign in to comment.