spec/rsync_spec.rb in rsync-1.0.7 vs spec/rsync_spec.rb in rsync-1.0.8
- old
+ new
@@ -1,8 +1,30 @@
require 'spec_helper'
require 'rsync'
describe Rsync do
+
+ context 'with configurations' do
+ before do
+ Rsync.configure do |config|
+ config.host = 'root@127.0.0.1'
+ end
+ end
+
+ it "should respond to host" do
+ Rsync.should respond_to(:host)
+ Rsync.host.should == 'root@127.0.0.1'
+ end
+
+ describe "run" do
+ it "prepend the host to the destination" do
+ Rsync::Command.stub(:run)
+ Rsync.run('/foo1', '/foo2', ["-a"])
+ Rsync::Command.should have_received(:run).with('/foo1', 'root@127.0.0.1:/foo2', ["-a"])
+ end
+ end
+ end
+
around(:each) do |example|
TempDir.create do |src, dest|
@src = src
@dest = dest
example.run