lib/taza/fixtures.rb in taza-0.8.7 vs lib/taza/fixtures.rb in taza-0.9.0
- old
+ new
@@ -1,13 +1,14 @@
require 'taza/fixture'
module Taza
- dirs = Dir.glob(File.join(Fixture.base_path,'*/'))
- dirs.unshift Fixture.base_path
- dirs.each do |dir|
- mod = dir.sub(Fixture.base_path,File.join(File.basename(Fixture.base_path),'')).camelize.sub(/::$/,'')
- self.class_eval <<-EOS
+ def self.load_fixtures
+ dirs = Dir.glob(File.join(Fixture.base_path,'*/'))
+ dirs.unshift Fixture.base_path
+ dirs.each do |dir|
+ mod = dir.sub(Fixture.base_path,File.join(File.basename(Fixture.base_path),'')).camelize.sub(/::$/,'')
+ self.class_eval <<-EOS
module #{mod}
def self.included(other_module)
fixture = Fixture.new
fixture.load_fixtures_from('#{dir}')
fixture.fixture_names.each do |fixture_name|
@@ -18,7 +19,10 @@
end
end
end
end
EOS
+ end
end
+
+ self.load_fixtures
end