spec/fs/rsync_command_spec.rb in em-fs-0.1.0 vs spec/fs/rsync_command_spec.rb in em-fs-0.1.1
- old
+ new
@@ -1,10 +1,10 @@
require 'spec_helper'
describe EM::FS::RsyncCommand do
context 'copying one file' do
- before :all do
+ before :each do
@source = File.join SPEC_ROOT, 'data', 'test'
@target = File.join SPEC_ROOT, 'data', 'test.copy'
@progress_updates = {}
EM.run do
EM::FS.rsync @source, @target do |on|
@@ -18,11 +18,11 @@
end
end
end
end
- after :all do
+ after :each do
FileUtils.rm_rf @target
end
it 'should create a copy' do
File.should exist @target
@@ -33,11 +33,11 @@
@progress_updates['test'].last.should == 102400
end
end
context 'copying multiple files' do
- before :all do
+ before :each do
@source1 = File.join SPEC_ROOT, 'data', 'test'
@source2 = File.join SPEC_ROOT, 'data', 'test2'
@source3 = File.join SPEC_ROOT, 'data', 'test3'
@target = File.join SPEC_ROOT, 'data', 'test.dir'
@progress_updates = {}
@@ -53,10 +53,10 @@
end
end
end
end
- after :all do
+ after :each do
FileUtils.rm_rf @target
end
it 'should create a copy' do
File.should exist @target