spec/lib/soloist/remote_spec.rb in soloist-1.0.1 vs spec/lib/soloist/remote_spec.rb in soloist-1.0.2

- old
+ new

@@ -102,13 +102,21 @@ subject.stub(:system => 1) expect { subject.system!("omg-wtf") }.to raise_error(Soloist::RemoteError) end end + describe "#key" do + let(:home_directory) { File.expand_path("~") } + + subject { Soloist::Remote.new("user", "host", "~/some_key") } + + its(:key) { should =~ %r|#{home_directory}/some_key| } + end + describe "#upload" do it "runs rsync with the specified arguments" do - Kernel.should_receive(:system).with("rsync -e 'ssh -i key' -avz --delete from user@host:to opts") + Kernel.should_receive(:system).with("rsync -e 'ssh -i #{subject.key}' -avz --delete from user@host:to opts") subject.upload("from", "to", "opts") end end describe ".from_uri" do @@ -125,11 +133,11 @@ Soloist::Remote.from_uri("1.2.3.4").user.should == "jim-bob" end end context "when a key is provided" do - subject { Soloist::Remote.from_uri("dude@whatever", "yo-some-key") } + subject { Soloist::Remote.from_uri("dude@whatever", "/yo-some-key") } - its(:key) { should == "yo-some-key" } + its(:key) { should == "/yo-some-key" } end end end