Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions spec/lib/dip/commands/ssh_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
describe Dip::Commands::SSH do
let(:cli) { Dip::CLI::SSH }

describe Dip::Commands::SSH::Up do
context "when without arguments", env: true do
let(:env) { {"HOME" => "/user"} }
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") }
Expand All @@ -25,15 +25,15 @@
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

context "when option `volume` is present" do
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

Expand Down