spec/remote_node_spec.rb in deplomat-0.1.1 vs spec/remote_node_spec.rb in deplomat-0.1.3
- old
+ new
@@ -46,12 +46,13 @@
@node.remove("#{@fixtures_dir}/dir2/*")
expect(@node.execute("ls #{@fixtures_dir}/dir2/")[:out]).to eq("")
end
it "uploads files from localhost to the node" do
- @node.upload("#{@local_fixtures_dir}/upload1/*", "#{@fixtures_dir}/uploaded1/")
+ @node.upload("#{@local_fixtures_dir}/upload1/*", "#{@fixtures_dir}/uploaded1/", except: 'except1')
expect(@node.execute("ls #{@fixtures_dir}/uploaded1/")[:out]).to have_files("uploaded_file1", "uploaded_file2")
+ expect(@node.execute("ls #{@fixtures_dir}/uploaded1/")[:out]).to not_have_files("except1")
end
it "changes current directory" do
#@node.cd("/etc")
#expect(@node.current_path).to eq("/etc/")
@@ -77,9 +78,15 @@
it "creates a symlink" do
@node.cd("#{@fixtures_dir}/dir2")
@node.create_symlink("../dir1", "./")
expect(@node.execute("ls dir1")[:out]).to have_files("file1", "file2", "subdir1")
+ end
+
+ it "doesn't log ls command when checking if folder exists in `cd`" do
+ expect(@node).to receive(:log).with("(deplomat-test-node) --> ls /home/deploy/deplomat/dir2\n", { color: "white"}).exactly(0).times
+ @node.cd("#{@fixtures_dir}/dir2")
+ allow(@node).to receive(:log)
end
end
describe "handling status and errors" do