aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorPaul Hieromnimon <paul.hieromnimon@gmail.com>2010-08-10 19:09:24 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-08-11 15:47:34 -0700
commit007c4da9ae3d5ad03a9eefd4dfccf9ca447715f1 (patch)
tree57955aa724aca4531155b777340971e2d9eae3d6 /activerecord/test/cases
parent7de03ec765e3160f5331fc17c8d7d332fa679d62 (diff)
downloadrails-007c4da9ae3d5ad03a9eefd4dfccf9ca447715f1.tar.gz
rails-007c4da9ae3d5ad03a9eefd4dfccf9ca447715f1.tar.bz2
rails-007c4da9ae3d5ad03a9eefd4dfccf9ca447715f1.zip
Raising exception if fixture file can't be found
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/fixtures_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/activerecord/test/cases/fixtures_test.rb b/activerecord/test/cases/fixtures_test.rb
index 93f8749255..a8c1c04f8b 100644
--- a/activerecord/test/cases/fixtures_test.rb
+++ b/activerecord/test/cases/fixtures_test.rb
@@ -153,6 +153,17 @@ class FixturesTest < ActiveRecord::TestCase
assert_not_nil Fixtures.new( Account.connection, "companies", 'Company', FIXTURES_ROOT + "/naked/yml/companies")
end
+ def test_nonexistent_fixture_file
+ nonexistent_fixture_path = FIXTURES_ROOT + "/imnothere"
+
+ #sanity check to make sure that this file never exists
+ assert Dir[nonexistent_fixture_path+"*"].empty?
+
+ assert_raise(FixturesFileNotFound) do
+ Fixtures.new( Account.connection, "companies", 'Company', nonexistent_fixture_path)
+ end
+ end
+
def test_dirty_dirty_yaml_file
assert_raise(Fixture::FormatError) do
Fixtures.new( Account.connection, "courses", 'Course', FIXTURES_ROOT + "/naked/yml/courses")