Sha256: 88707917709d2a8b4918af8ee52abcc2bd00fe49950ed035d418f4af74a20a49
Contents?: true
Size: 875 Bytes
Versions: 3
Compression:
Stored size: 875 Bytes
Contents
module BraceTestHelpers 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_brace(arguments = nil) Dir.chdir(tmp_path) do Bundler.with_clean_env do ENV['TESTING'] = '1' %x(#{brace_bin} #{APP_NAME} #{arguments}) end end end def drop_dummy_database if File.exist?(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 brace_bin File.join(root_path, 'bin', 'brace') end def root_path File.expand_path('../../../', __FILE__) end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
brace-0.1.0 | spec/support/braces.rb |
brace-0.0.3 | spec/support/braces.rb |
brace-0.0.1 | spec/support/braces.rb |