spec/dir_spec.rb in vfs-0.1.1 vs spec/dir_spec.rb in vfs-0.2

- old
+ new

@@ -1,9 +1,9 @@ require 'spec_helper' describe 'Dir' do - before :each do + before do @fs = '/'.to_entry_on(Vfs::Storages::HashFs.new) @path = @fs['/a/b/c'] end describe 'existence' do @@ -85,11 +85,11 @@ @path.dir.destroy!.should == @path end end describe 'content' do - before :each do + before do @path.dir('dir').create @path.dir('dir/another_dir').create @path.file('file').create end @@ -124,11 +124,11 @@ it 'empty?' end describe 'copying' do - before :each do + before do @from = @path.dir @from.create @from.file('file').write 'something' @from.dir('dir').create.tap do |dir| dir.file('file2').write 'something2' @@ -195,21 +195,21 @@ end describe 'general copy' do it_should_behave_like 'copy_to behavior' - before :each do + before do # we using here another HashFs storage, to prevent :effective_dir_copy to be used @to = '/'.to_entry_on(Vfs::Storages::HashFs.new)['to'] @from.storage.should_not_receive(:for_spec_helper_effective_copy_used) end end describe 'effective copy' do it_should_behave_like 'copy_to behavior' - before :each do + before do # we using the same HashFs storage, so :effective_dir_copy will be used @to = @fs['to'] # @from.storage.should_receive(:for_spec_helper_effective_copy_used).at_least(1).times end \ No newline at end of file