Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

spec for insert/updates in raw mode

  • Loading branch information...
commit b2ac78c61210b0f83ddf7b212b7cd3f0b5227894 1 parent 7ffe57a
@tmm1 authored
Showing with 14 additions and 0 deletions.
  1. +14 −0 lib/em/mysql.rb
View
14 lib/em/mysql.rb
@@ -442,6 +442,20 @@ def SQL(query, &blk) SQL.select(query, &blk) end
}
end
+ should 'allow access to insert_id in raw mode' do
+ SQL.raw('insert into evented_mysql_test (num) values (20), (21), (22)'){ |mysql|
+ mysql.insert_id.should == 4
+ done
+ }
+ end
+
+ should 'allow access to affected_rows in raw mode' do
+ SQL.raw('update evented_mysql_test set num = num + 10'){ |mysql|
+ mysql.affected_rows.should == 6
+ done
+ }
+ end
+
should 'fire error callback with exceptions' do
SQL.settings.update :on_error => proc{ |e|
e.class.should == Mysql::Error
Please sign in to comment.
Something went wrong with that request. Please try again.