rethinkdb/rethinkdb — pull request #205 by presidentbeef (2013-01-04 01:25:08+00:00)
Title: Reorganize Ruby driver tests

As promised, I cleaned up the tests for the Ruby driver a little bit.

The cleanup does change how tests execute:

* Tables are truncated and repopulated before each test
* Randomly-named dbs/tables are deleted after test
* Tests are expected to be executed through `test.rb` and not individual files
* No more "Welcome_rdb" table
* Tests should be independent. The tests in `test_det.rb` were so dependent I just merged them into a single test until future untangling

Clean up included:

* Moving duplicated code into a helper module
* Moving nested methods into a helper module
* Reformatting code via Ruby2Ruby, which made most code better but some arguably uglier
* Swapping `assert_equal` argument order for correct failure messages (automated, so if any were already correct they are now wrong)
* Removing global variables

Bad news: tests are now considerably slower, likely due to the deleting/populating of tables.