diff --git a/features/support/hooks.rb b/features/support/hooks.rb index de2429e..fb89f01 100644 --- a/features/support/hooks.rb +++ b/features/support/hooks.rb @@ -1,10 +1,10 @@ -Before do - if !$dunit +Before do + if !$dunit command = "#{RAILS_ROOT}/plugins/mezuro/script/tests/prepare_kalibro_query_file.sh" system command - $dunit = true - end -end + $dunit = true + end +end After ('@kalibro_restart') do command = "#{RAILS_ROOT}/plugins/mezuro/script/tests/delete_all_kalibro_entries.sh" diff --git a/plugins/mezuro/script/tests/kalibro_scripts.conf b/plugins/mezuro/script/tests/kalibro_scripts.conf index 7896a5c..bf0d172 100644 --- a/plugins/mezuro/script/tests/kalibro_scripts.conf +++ b/plugins/mezuro/script/tests/kalibro_scripts.conf @@ -1,8 +1,6 @@ # Definition of constants used in kalibro scripts. -KALIBRO_DIR=~/kalibro -PSQLFILE=$KALIBRO_DIR/KalibroCore/src/META-INF/PostgreSQL.sql +PSQLFILE=/tmp/PostgreSQL.sql DATABASE="kalibro_test" PASSWORD="kalibro" -QUERYFILE=/tmp/query - +QUERYFILE=/tmp/query \ No newline at end of file diff --git a/plugins/mezuro/script/tests/prepare_kalibro_query_file.sh b/plugins/mezuro/script/tests/prepare_kalibro_query_file.sh index 910178b..f88c008 100755 --- a/plugins/mezuro/script/tests/prepare_kalibro_query_file.sh +++ b/plugins/mezuro/script/tests/prepare_kalibro_query_file.sh @@ -1,6 +1,9 @@ #!/bin/bash source plugins/mezuro/script/tests/kalibro_scripts.conf +if ! [ -f $PSQLFILE ] + then wget http://gitorious.org/kalibro/kalibro/blobs/raw/master/KalibroCore/src/META-INF/PostgreSQL.sql -O $PSQLFILE +fi DROPLIMIT="END OF DROP TABLES" RANGE=$(grep -n "$DROPLIMIT" $PSQLFILE | cut -d":" -f1) @@ -14,4 +17,4 @@ if [ -f $QUERYFILE ] fi sed -e "$CUT" -e "$REPLACE" $PSQLFILE > $QUERYFILE -sudo chown postgres.postgres $QUERYFILE +sudo chown postgres.postgres $QUERYFILE \ No newline at end of file -- libgit2 0.21.2