From 99d308c817e14c2f94a2659d71a34eab93d038d0 Mon Sep 17 00:00:00 2001 From: Denis Zaratan Pasin Date: Tue, 20 Apr 2021 15:07:05 +0900 Subject: [PATCH 1/2] SSH test are not bound to host env variables --- spec/lib/dip/commands/ssh_spec.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/spec/lib/dip/commands/ssh_spec.rb b/spec/lib/dip/commands/ssh_spec.rb index 496ecac..d27f307 100644 --- a/spec/lib/dip/commands/ssh_spec.rb +++ b/spec/lib/dip/commands/ssh_spec.rb @@ -7,10 +7,9 @@ describe Dip::Commands::SSH do let(:cli) { Dip::CLI::SSH } - describe Dip::Commands::SSH::Up do - context "when without arguments", env: true do + describe Dip::Commands::SSH::Up, env: true do let(:env) { {"HOME" => "/user"} } - + context "when without arguments" do before { cli.start "up".shellsplit } it { expected_subprocess("docker", "volume create --name ssh_data") } @@ -25,7 +24,7 @@ before { cli.start "up --key /foo/bar-baz-rsa".shellsplit } it { expected_subprocess("docker", - "run --rm --volume ssh_data:/ssh --volume /root:/root --interactive --tty whilp/ssh-agent ssh-add /foo/bar-baz-rsa") + "run --rm --volume ssh_data:/ssh --volume /user:/user --interactive --tty whilp/ssh-agent ssh-add /foo/bar-baz-rsa") } end @@ -33,7 +32,7 @@ before { cli.start "up --volume /foo/.ssh".shellsplit } it { expected_subprocess("docker", - "run --rm --volume ssh_data:/ssh --volume /foo/.ssh:/foo/.ssh --interactive --tty whilp/ssh-agent ssh-add /root/.ssh/id_rsa") + "run --rm --volume ssh_data:/ssh --volume /foo/.ssh:/foo/.ssh --interactive --tty whilp/ssh-agent ssh-add /user/.ssh/id_rsa") } end From 4b1862cc52ed54f6051fb67927253a41a203b48b Mon Sep 17 00:00:00 2001 From: Denis Zaratan Pasin Date: Tue, 20 Apr 2021 20:16:33 +0900 Subject: [PATCH 2/2] standardrb --fix --- spec/lib/dip/commands/ssh_spec.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/lib/dip/commands/ssh_spec.rb b/spec/lib/dip/commands/ssh_spec.rb index d27f307..1f8397c 100644 --- a/spec/lib/dip/commands/ssh_spec.rb +++ b/spec/lib/dip/commands/ssh_spec.rb @@ -8,7 +8,8 @@ let(:cli) { Dip::CLI::SSH } describe Dip::Commands::SSH::Up, env: true do - let(:env) { {"HOME" => "/user"} } + let(:env) { {"HOME" => "/user"} } + context "when without arguments" do before { cli.start "up".shellsplit }