diff --git a/tests/sharing/Gemfile b/tests/sharing/Gemfile
index eb420d32ab8263291419b53118b5d95fcc2f5fcd..f48ca77e618b504e2846e42cf2a84309d829c454 100644
--- a/tests/sharing/Gemfile
+++ b/tests/sharing/Gemfile
@@ -3,4 +3,5 @@ source 'https://rubygems.org'
 gem "awesome_print"
 gem "faker"
 gem "pry"
+gem "pry-rescue"
 gem "rest-client"
diff --git a/tests/sharing/Gemfile.lock b/tests/sharing/Gemfile.lock
index 1c6aa203515230b8e60c2a77070e34905b79f2d7..c91fb68c48f96786961a98573b3cee30517c03fc 100644
--- a/tests/sharing/Gemfile.lock
+++ b/tests/sharing/Gemfile.lock
@@ -12,6 +12,7 @@ GEM
       domain_name (~> 0.5)
     i18n (1.0.0)
       concurrent-ruby (~> 1.0)
+    interception (0.5)
     method_source (0.9.0)
     mime-types (3.1)
       mime-types-data (~> 3.2015)
@@ -20,6 +21,9 @@ GEM
     pry (0.11.3)
       coderay (~> 1.1.0)
       method_source (~> 0.9.0)
+    pry-rescue (1.4.5)
+      interception (>= 0.5)
+      pry
     rest-client (2.0.2)
       http-cookie (>= 1.0.2, < 2.0)
       mime-types (>= 1.16, < 4.0)
@@ -35,6 +39,7 @@ DEPENDENCIES
   awesome_print
   faker
   pry
+  pry-rescue
   rest-client
 
 BUNDLED WITH
diff --git a/tests/sharing/lib/stack.rb b/tests/sharing/lib/stack.rb
index 538064271de86d812088cfbfdfb8ef7f0a771ea4..5ac5652cf63dd113b41f10c02fb7e54ff7aa0830 100644
--- a/tests/sharing/lib/stack.rb
+++ b/tests/sharing/lib/stack.rb
@@ -30,17 +30,17 @@ class Stack
     cmd = ["cozy-stack", "instances", "add", inst.domain, "--dev",
            "--passphrase", inst.passphrase, "--public-name", inst.name,
            "--email", inst.email, "--settings", "context:test",
-           "--admin-port", @admin, "--locale", "fr"]
+           "--admin-port", @admin.to_s, "--locale", "fr"]
     puts cmd.join(" ").green
-    system cmd.join(" ")
+    system(*cmd)
   end
 
   def install_app(inst, app)
     key = inst.domain + "/" + app
     return if @apps[key]
     cmd = ["cozy-stack", "apps", "install", app,
-           "--domain", inst.domain,
-           "--port", @port, "--admin-port", @admin]
+           "--port", @port, "--admin-port", @admin,
+           "--domain", inst.domain, ">", "/dev/null"]
     puts cmd.join(" ").green
     @apps[key] = system cmd.join(" ")
   end
diff --git a/tests/sharing/tests/push_folder.rb b/tests/sharing/tests/push_folder.rb
index 290abae07db9a31d8d239f33aaf3314087f93ae5..67d04b9773560f20e5ccdc37b8a124d4294a72e4 100755
--- a/tests/sharing/tests/push_folder.rb
+++ b/tests/sharing/tests/push_folder.rb
@@ -2,6 +2,7 @@
 
 require_relative '../boot'
 require 'minitest/autorun'
+require 'pry-rescue/minitest'
 
 describe "A folder" do
   Helpers.scenario "push_folder"