spec/shelly/app_spec.rb in shelly-0.1.9 vs spec/shelly/app_spec.rb in shelly-0.1.10
- old
+ new
@@ -310,31 +310,33 @@
Launchy.should_receive(:open).with("http://example.com")
@app.open
end
end
- describe "#node_and_console" do
- it "should fetch instance data from Api" do
- @client.should_receive(:node_and_port).with("foo-staging")
- @app.node_and_port
- end
- end
-
describe "#console" do
it "should run ssh with all parameters" do
@client.stub(:node_and_port).and_return(
{"node_ip" => "10.0.0.1", "port" => "40010", "user" => "foo"})
@app.should_receive(:exec).with("ssh -o StrictHostKeyChecking=no -p 40010 -l foo 10.0.0.1 ")
@app.console
end
end
describe "#upload" do
- it "should run rsync with all parameters" do
+ it "should run rsync with proper parameters" do
@client.stub(:node_and_port).and_return(
{"node_ip" => "10.0.0.1", "port" => "40010", "user" => "foo"})
- @app.should_receive(:exec).with("rsync -avz -e 'ssh -o StrictHostKeyChecking=no -p 40010' --progress /path foo@10.0.0.1:/srv/glusterfs/disk")
+ @app.should_receive(:exec).with("rsync -avz -e 'ssh -o StrictHostKeyChecking=no -p 40010 -l foo' --progress /path 10.0.0.1:/srv/glusterfs/disk")
@app.upload("/path")
+ end
+ end
+
+ describe "#download" do
+ it "should run rsync with proper parameters" do
+ @client.stub(:node_and_port).and_return(
+ {"node_ip" => "10.0.0.1", "port" => "40010", "user" => "foo"})
+ @app.should_receive(:exec).with("rsync -avz -e 'ssh -o StrictHostKeyChecking=no -p 40010 -l foo' --progress 10.0.0.1:/srv/glusterfs/disk/. /tmp")
+ @app.download(".", "/tmp")
end
end
describe "#create_cloudfile" do
it "should create cloudfile with app attributes" do