spec/support/onotole.rb in onotole-1.0.4 vs spec/support/onotole.rb in onotole-1.0.6

- old
+ new

@@ -9,10 +9,13 @@ def create_tmp_directory FileUtils.mkdir_p(tmp_path) end def run_onotole(arguments = nil) + # unless !pgsql_db_exist?("#{APP_NAME}_development") || !pgsql_db_exist?("#{APP_NAME}_test") + # allow(STDIN).to receive(:gets) { 'Y' } + # end Dir.chdir(tmp_path) do Bundler.with_clean_env do add_fakes_to_path ` #{onotole_bin} #{APP_NAME} #{arguments} @@ -53,7 +56,11 @@ File.join(root_path, 'spec', 'fakes', 'bin') end def root_path File.expand_path('../../../', __FILE__) + end + + def pgsql_db_exist?(db_name) + system "psql -l | grep #{db_name}" end end