Commit b64f0a3b authored by Mikaël Salson's avatar Mikaël Salson Committed by Mathieu Giraud
Browse files

browser/tests/functional: Get directory of current script

This is a safer way to do that than doing a pwd (the script may be launched
from another directory).
parent 1a7411aa
...@@ -27,7 +27,7 @@ class BrowserTest < MiniTest::Test ...@@ -27,7 +27,7 @@ class BrowserTest < MiniTest::Test
end end
def set_browser(vidjil_file, analysis_file=nil) def set_browser(vidjil_file, analysis_file=nil)
folder_path = Dir.pwd folder_path = File.expand_path(File.dirname(__FILE__))
folder_path.sub! '/browser/test/functional', '' folder_path.sub! '/browser/test/functional', ''
index_path = 'file://' + folder_path + '/browser/index.html' index_path = 'file://' + folder_path + '/browser/index.html'
data_path = folder_path + vidjil_file data_path = folder_path + vidjil_file
......
...@@ -5,7 +5,7 @@ class SegmenterTest < BrowserTest ...@@ -5,7 +5,7 @@ class SegmenterTest < BrowserTest
def set_browser def set_browser
# Redefine set_browser as the tested webpage is totally different # Redefine set_browser as the tested webpage is totally different
folder_path = Dir.pwd folder_path = File.expand_path(File.dirname(__FILE__))
folder_path.sub! '/browser/test/functional', '' folder_path.sub! '/browser/test/functional', ''
index_path = 'file://' + folder_path + '/browser/segmenter_page.html' index_path = 'file://' + folder_path + '/browser/segmenter_page.html'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment