Permalink
Browse files

Restructuring test files to make it easier to find things.

  • Loading branch information...
1 parent 7b4b237 commit 677e7f7d364cc85b1e2b80b17e6744d9f4bff22b @JEG2 committed Feb 7, 2010
View
@@ -8,7 +8,7 @@ task :default => :test
Rake::TestTask.new do |test|
test.libs << "test"
- test.pattern = "test/*_test.rb"
+ test.pattern = "test/**/*_test.rb"
test.warning = true
test.verbose = true
end
@@ -1,5 +1,5 @@
require "test_helper"
-require "shared_binary_data"
+require "shared/binary_data_tests"
class TestBTreeBinaryData < Test::Unit::TestCase
def setup
@@ -15,7 +15,7 @@ def teardown
remove_db_files
end
- include SharedBinaryData
+ include BinaryDataTests
def test_null_bytes_are_preserved_during_value_iteration
@db.each_value do |value|
@@ -1,12 +1,12 @@
require "test_helper"
-require "shared_tuning"
+require "shared/tuning_tests"
class TestBTreeTuning < Test::Unit::TestCase
def teardown
remove_db_files
end
- include SharedTuning
+ include TuningTests
def test_leaf_members_can_be_set_with_other_tuning_defaults
members = rand(1_000) + 1
@@ -1,5 +1,5 @@
require "test_helper"
-require "shared_iteration"
+require "shared/iteration_tests"
class TestCursorBasedIteration < Test::Unit::TestCase
def setup
@@ -16,7 +16,7 @@ def teardown
remove_db_files
end
- include SharedIteration
+ include IterationTests
def test_each_key_can_begin_iteration_at_a_passed_key
@db.each_key("b") do |key|
@@ -1,5 +1,5 @@
require "test_helper"
-require "shared_binary_data"
+require "shared/binary_data_tests"
class TestBinaryData < Test::Unit::TestCase
def setup
@@ -14,7 +14,7 @@ def teardown
remove_db_files
end
- include SharedBinaryData
+ include BinaryDataTests
def test_keys_and_values_can_be_read_with_null_bytes
assert_equal(@value, @db[@key])
File renamed without changes.
@@ -1,5 +1,5 @@
require "test_helper"
-require "shared_storage"
+require "shared/storage_tests"
class TestGettingAndSettingKeys < Test::Unit::TestCase
def setup
@@ -11,7 +11,7 @@ def teardown
remove_db_files
end
- include SharedStorage
+ include StorageTests
def test_a_key_value_pair_can_be_stored_and_fetched_from_the_database
assert_equal("value", @db.store("key", "value"))
@@ -1,5 +1,5 @@
require "test_helper"
-require "shared_iteration"
+require "shared/iteration_tests"
class TestIteration < Test::Unit::TestCase
def setup
@@ -16,5 +16,5 @@ def teardown
remove_db_files
end
- include SharedIteration
+ include IterationTests
end
File renamed without changes.
@@ -1,12 +1,12 @@
require "test_helper"
-require "shared_hash_tuning"
+require "shared/hash_tuning_tests"
class TestTuning < Test::Unit::TestCase
def teardown
remove_db_files
end
- include SharedHashTuning
+ include HashTuningTests
def test_limit_for_cached_records_can_be_set
limit = rand(1_000) + 1
@@ -1,4 +1,4 @@
-module SharedBinaryData
+module BinaryDataTests
def test_null_bytes_are_preserved_during_key_iteration
@db.each_key do |key|
assert_equal(@key, key)
@@ -1,7 +1,7 @@
-require "shared_tuning"
+require "shared/tuning_tests"
-module SharedHashTuning
- include SharedTuning
+module HashTuningTests
+ include TuningTests
def test_a_bucket_array_size_can_be_set_with_other_tuning_defaults
size = rand(1_000) + 1
@@ -1,4 +1,4 @@
-module SharedIteration
+module IterationTests
def test_each_key_iterates_over_all_keys_in_the_database
@db.each_key do |key|
@keys.delete(key)
File renamed without changes.
File renamed without changes.
@@ -1,4 +1,4 @@
-module SharedStorage
+module StorageTests
def test_fetching_a_missing_value_fails_with_an_index_error
assert_raise(IndexError) do
@db.fetch(:missing)
@@ -1,4 +1,4 @@
-module SharedTuning
+module TuningTests
def test_a_mutex_can_be_activated_as_the_database_is_created
assert_option_calls([:setmutex], :mutex => true)
end
@@ -1,5 +1,5 @@
require "test_helper"
-require "shared_iteration"
+require "shared/iteration_tests"
class TestDocumentIteration < Test::Unit::TestCase
def setup
@@ -18,5 +18,5 @@ def teardown
remove_db_files
end
- include SharedIteration
+ include IterationTests
end
@@ -1,5 +1,5 @@
require "test_helper"
-require "shared_storage"
+require "shared/storage_tests"
class TestDocumentStorage < Test::Unit::TestCase
def setup
@@ -11,7 +11,7 @@ def teardown
remove_db_files
end
- include SharedStorage
+ include StorageTests
def test_a_document_can_be_stored_and_fetched_from_the_database
document = {"a" => "1", "b" => "2"}
@@ -1,12 +1,12 @@
require "test_helper"
-require "shared_hash_tuning"
+require "shared/hash_tuning_tests"
class TestTableTuning < Test::Unit::TestCase
def teardown
remove_db_files
end
- include SharedHashTuning
+ include HashTuningTests
def test_records_cached_can_be_set_with_other_cache_defaults
records = rand(1_000) + 1

0 comments on commit 677e7f7

Please sign in to comment.