Sha256: 97de006bf02a4eca5f8313577b0ef2508db63999c51d3d835e8caed1e7a4bc86
Contents?: true
Size: 886 Bytes
Versions: 28
Compression:
Stored size: 886 Bytes
Contents
module JetfuelTestHelpers APP_NAME = 'dummy' def remove_project_directory FileUtils.rm_rf(project_path) end def create_tmp_directory FileUtils.mkdir_p(tmp_path) end def run_jetfuel(arguments = nil) Dir.chdir(tmp_path) do Bundler.with_clean_env do ENV['TESTING'] = '1' %x(#{jetfuel_bin} #{APP_NAME} #{arguments}) end end end def drop_dummy_database if File.exists?(project_path) Dir.chdir(project_path) do Bundler.with_clean_env do `rake db:drop` end end end end def project_path @project_path ||= Pathname.new("#{tmp_path}/#{APP_NAME}") end private def tmp_path @tmp_path ||= Pathname.new("#{root_path}/tmp") end def jetfuel_bin File.join(root_path, 'bin', 'jetfuel') end def root_path File.expand_path('../../../', __FILE__) end end
Version data entries
28 entries across 28 versions & 1 rubygems