spec/spec_helper.rb
def load_fixtures
  Dir['./spec/fixtures/*'].each do |file|
    define_method "#{File.basename(file, '.yml')}_fixture".to_sym do
      YAML.load_file(file)
    end
  end
end
# loads all the fixtures under spec/fixtures/*.yml creates methods based on
# file names, so spec/fixtures/data.yml creates method data_fixture
# which can be used from tests
loads all the fixtures under spec/fixtures.yml creates methods based on
file names, so spec/fixtures/data.yml creates method data_fixture
which can be used from tests
loads all the fixtures under spec / fixtures . yml creates methods based on file names so spec / fixtures / data . yml creates method data_fixture which can be used from tests
def load_fixtures
  Dir['./spec/fixtures/*'].each do |file|
    define_method "#{File.basename(file, '.yml')}_fixture".to_sym do
      YAML.load_file(file)
    end
  end
end
def load_fixtures Dir [ './spec/fixtures/*' ] . each do | file | define_method "#{File.basename(file, '.yml')}_fixture" . to_sym do YAML . load_file ( file ) end end end
loads all the fixtures under spec/fixtures/*.yml creates methods based on
file names, so spec/fixtures/data.yml creates method data_fixture
which can be used from tests
loads all the fixtures under spec / fixtures / * . yml creates methods based on file names so spec / fixtures / data . yml creates method data_fixture which can be used from tests