spec/support/fixtures.rb in i18n-tasks-0.2.22 vs spec/support/fixtures.rb in i18n-tasks-0.3.0.rc1
- old
+ new
@@ -1,7 +1,14 @@
# quick'n'dirty fixture loader
module FixturesSupport
- def load_fixture(path)
- Pathname.new('spec/fixtures').join(path).expand_path.read
+ def fixtures_contents
+ @fixtures_contents ||= begin
+ fixtures_path = 'spec/fixtures'
+ Dir.glob("#{fixtures_path}/**/*").inject({}) { |h, path|
+ next h if File.directory?(path)
+ h[path[fixtures_path.length + 1..-1]] = Pathname.new(path).read
+ h
+ }
+ end
end
end