aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-12-10 15:32:14 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2011-12-10 16:32:07 -0800
commitd09b67cfc0df87e39b257409fad72f7bb6d72a41 (patch)
tree2a91c077434983ed049115777f8018eb4fce4595 /activerecord
parent4beaa9b839c3ab0574a18174018adae109212c0e (diff)
downloadrails-d09b67cfc0df87e39b257409fad72f7bb6d72a41.tar.gz
rails-d09b67cfc0df87e39b257409fad72f7bb6d72a41.tar.bz2
rails-d09b67cfc0df87e39b257409fad72f7bb6d72a41.zip
Errno::ENOENT error makes more sense when a file cannot be found
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/fixtures.rb10
-rw-r--r--activerecord/test/cases/fixtures_test.rb2
2 files changed, 1 insertions, 11 deletions
diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb
index cad9417216..c33b37b0ab 100644
--- a/activerecord/lib/active_record/fixtures.rb
+++ b/activerecord/lib/active_record/fixtures.rb
@@ -22,8 +22,6 @@ else
end
end
-class FixturesFileNotFound < StandardError; end
-
module ActiveRecord
# \Fixtures are a way of organizing data that you want to test against; in short, sample data.
#
@@ -644,14 +642,6 @@ module ActiveRecord
end
def read_fixture_files
- if ::File.file?(yaml_file_path)
- read_yaml_fixture_files
- else
- raise FixturesFileNotFound, "Could not find #{yaml_file_path}"
- end
- end
-
- def read_yaml_fixture_files
yaml_files = Dir["#{@fixture_path}/**/*.yml"].select { |f|
::File.file?(f)
} + [yaml_file_path]
diff --git a/activerecord/test/cases/fixtures_test.rb b/activerecord/test/cases/fixtures_test.rb
index 7e2dafcd01..99dd74c561 100644
--- a/activerecord/test/cases/fixtures_test.rb
+++ b/activerecord/test/cases/fixtures_test.rb
@@ -179,7 +179,7 @@ class FixturesTest < ActiveRecord::TestCase
#sanity check to make sure that this file never exists
assert Dir[nonexistent_fixture_path+"*"].empty?
- assert_raise(FixturesFileNotFound) do
+ assert_raise(Errno::ENOENT) do
ActiveRecord::Fixtures.new( Account.connection, "companies", 'Company', nonexistent_fixture_path)
end
end