public
Rubygem
Description: An ActiveRecord to the DBSlayer lightweight proxy/pooling layer (http://code.nytimes.com/projects/dbslayer)
Clone URL: git://github.com/harrisj/activerecord-dbslayer-adapter.git
Tweaking test coverage a little
harrisj (author)
Sat Jun 07 07:39:08 -0700 2008
commit  b2e881ee0a4e75e07a358c5bf38ba4cfa5f5c0ff
tree    4e5137cda0ad2386e679af6278102f685d200f0e
parent  71a10388996920e4171f8332e01e11e260748846
...
16
17
18
19
 
 
20
21
22
...
45
46
47
 
48
49
50
...
16
17
18
 
19
20
21
22
23
...
46
47
48
49
50
51
52
0
@@ -16,7 +16,8 @@ class Test_ActiveRecord_ConnectionAdapters_DbslayerAdapter < Test::Unit::TestCas
0
   end
0
   
0
   def test_active_fail?
0
-
0
+ @adapter.raw_connection.expects(:mysql_stats).raises(RuntimeError)
0
+ assert_equal false, @adapter.active?
0
   end
0
   
0
   def test_select_rows
0
@@ -45,6 +46,7 @@ class Test_ActiveRecord_ConnectionAdapters_DbslayerAdapter < Test::Unit::TestCas
0
     assert_equal 42, affected_rows
0
   end
0
   
0
+
0
   def test_tables
0
     @adapter.raw_connection.expects(:cmd_execute).with(:db, sql_hash("SHOW TABLES")).returns(SHOW_TABLES_REPLY)
0
     tables = @adapter.tables
...
34
35
36
 
 
 
 
 
 
 
 
 
37
38
39
...
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
0
@@ -34,6 +34,15 @@ class Test_ActiveRecord_ConnectionAdapters_DbslayerResults < Test::Unit::TestCas
0
     assert !@result.success?
0
   end
0
   
0
+ def test_num_rows_nil
0
+ @result = ActiveRecord::ConnectionAdapters::DbslayerResult.new({})
0
+ assert_equal 0, @result.num_rows
0
+ end
0
+
0
+ def test_num_rows
0
+ assert_equal 10, @result.num_rows
0
+ end
0
+
0
   def test_hash_rows
0
     assert_equal CITY_HASH_ROWS, @result.hash_rows
0
   end

Comments

    No one has commented yet.