Sha256: 17ba850dfb55c54a51179e98238cf7b9584a156e2387f1123073796b60b8eb0b
Contents?: true
Size: 1.01 KB
Versions: 32
Compression:
Stored size: 1.01 KB
Contents
module FactoryGirlDefinitionsHelper def append_file_to_factory_girl_definitions_path(path_to_file) FactoryGirl.definition_file_paths ||= [] FactoryGirl.definition_file_paths << path_to_file end end World(FactoryGirlDefinitionsHelper) When /^"([^"]*)" is added to FactoryGirl's file definitions path$/ do |file_name| new_factory_file = File.join(current_dir, file_name.gsub(".rb", "")) append_file_to_factory_girl_definitions_path(new_factory_file) step %{I find definitions} end When /^"([^"]*)" is added to FactoryGirl's file definitions path as an absolute path$/ do |file_name| new_factory_file = File.expand_path(File.join(current_dir, file_name.gsub(".rb", ""))) append_file_to_factory_girl_definitions_path(new_factory_file) step %{I find definitions} end When /^I create a "([^"]*)" instance from FactoryGirl$/ do |factory_name| FactoryGirl.create(factory_name) end When /^I find definitions$/ do FactoryGirl.find_definitions end When /^I reload factories$/ do FactoryGirl.reload end
Version data entries
32 entries across 24 versions & 7 rubygems