Skip to content

Commit

Permalink
Added a spec for the correct mysql server_version caching behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
Hannes Georg authored and jeremyevans committed Aug 16, 2012
1 parent 5890814 commit f17e966
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions spec/adapters/mysql_spec.rb
Expand Up @@ -367,6 +367,14 @@ def logger.method_missing(m, msg)
MYSQL_DB.server_version.should >= 40000
end

specify "should cache the server version" do
# warm cache:
MYSQL_DB.server_version
expect{
100.times{ MYSQL_DB.server_version }
}.not_to change(MYSQL_DB.sqls, :size)
end

specify "should support for_share" do
MYSQL_DB.transaction{MYSQL_DB[:test2].for_share.all.should == []}
end
Expand Down

0 comments on commit f17e966

Please sign in to comment.