summaryrefslogtreecommitdiffhomepage
path: root/test/unit/applications
diff options
context:
space:
mode:
authorOisin Canty <o.canty@f5.com>2021-07-02 13:00:04 +0000
committerOisin Canty <o.canty@f5.com>2021-07-02 13:00:04 +0000
commit6c14d5d7b1921bd78f2d1b7458eae7d97eee0fcd (patch)
tree371aa339095bc5f5d50629f96bdd768e1424bfe1 /test/unit/applications
parent655e321075c0beebe14eba83deeac1ba4c9e0b29 (diff)
downloadunit-6c14d5d7b1921bd78f2d1b7458eae7d97eee0fcd.tar.gz
unit-6c14d5d7b1921bd78f2d1b7458eae7d97eee0fcd.tar.bz2
Tests: run Ruby applications inside temporary directory.
Diffstat (limited to 'test/unit/applications')
-rw-r--r--test/unit/applications/lang/ruby.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/test/unit/applications/lang/ruby.py b/test/unit/applications/lang/ruby.py
index 02644584..d95d62b4 100644
--- a/test/unit/applications/lang/ruby.py
+++ b/test/unit/applications/lang/ruby.py
@@ -1,12 +1,26 @@
+import os
+import shutil
+
from unit.applications.proto import TestApplicationProto
from unit.option import option
+from unit.utils import public_dir
class TestApplicationRuby(TestApplicationProto):
application_type = "ruby"
+ def prepare_env(self, script):
+ shutil.copytree(
+ option.test_dir + '/ruby/' + script,
+ option.temp_dir + '/ruby/' + script
+ )
+
+ public_dir(option.temp_dir + '/ruby/' + script)
+
def load(self, script, name='config.ru', **kwargs):
- script_path = option.test_dir + '/ruby/' + script
+ self.prepare_env(script)
+
+ script_path = option.temp_dir + '/ruby/' + script
self._load_conf(
{