features/support/world.rb in captain_hoog-1.0.2 vs features/support/world.rb in captain_hoog-1.1.0
- old
+ new
@@ -25,8 +25,23 @@
end
def hook_config_file_path
git_project_path.join('hoogfile.yml')
end
+
+ def write_file(path, file_content)
+ File.open(path, 'w') { |file| file.write(file_content) }
+ end
+
+ def write_spec(name, file_content)
+ spec_name = File.expand_path(File.join(File.dirname(__FILE__),
+ '..',
+ '..',
+ 'spec',
+ 'hooks',
+ "#{name}.rb"))
+ write_file(spec_name, file_content)
+ end
+
end
World(FileWorld)