summaryrefslogtreecommitdiff
path: root/features/support/hooks.rb
diff options
context:
space:
mode:
authorazul <azul@leap.se>2014-07-17 12:16:07 +0200
committerazul <azul@leap.se>2014-07-17 12:16:07 +0200
commitade74d8a9091ae607586d7b287a0579a2ee7af8e (patch)
tree74273b8ba7e35d0fb3c96aa79e63c93086d15146 /features/support/hooks.rb
parent952bc18e8333ca5c3e6e16f8059f84a1414d5f6f (diff)
parente86cccb4b89540f3bd403110d051b2723be781b9 (diff)
Merge pull request #176 from azul/feature/api-authenticated-configs
API: Authenticated access to config settings
Diffstat (limited to 'features/support/hooks.rb')
-rw-r--r--features/support/hooks.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/features/support/hooks.rb b/features/support/hooks.rb
new file mode 100644
index 0000000..19928d8
--- /dev/null
+++ b/features/support/hooks.rb
@@ -0,0 +1,18 @@
+After '@tempfile' do
+ if @tempfile
+ @tempfile.close
+ @tempfile.unlink
+ end
+end
+
+After do |scenario|
+ if scenario.failed?
+ logfile_path = Rails.root + 'tmp'
+ logfile_path += "#{scenario.title.gsub(/\s/, '_')}.log"
+ File.open(logfile_path, 'w') do |test_log|
+ test_log.puts scenario.title
+ test_log.puts "========================="
+ test_log.puts `tail log/test.log -n 200`
+ end
+ end
+end