lib/vfs/storages/specification.rb in vfs-0.3.11 vs lib/vfs/storages/specification.rb in vfs-0.3.12

- old
+ new

@@ -34,36 +34,36 @@ end it "file attributes" do @storage.open_fs do |fs| fs.attributes(@remote_file).should == {} - fs.write_file(@remote_file, false){|w| w.call 'something'} + fs.write_file(@remote_file, false){|w| w.write 'something'} attrs = fs.attributes(@remote_file) fs.attributes(@remote_file).subset(:file, :dir).should == {file: true, dir: false} end end it "read, write & append" do @storage.open_fs do |fs| - fs.write_file(@remote_file, false){|w| w.call 'something'} + fs.write_file(@remote_file, false){|w| w.write 'something'} fs.attributes(@remote_file)[:file].should be_true data = "" fs.read_file(@remote_file){|buff| data << buff} data.should == 'something' # append - fs.write_file(@remote_file, true){|w| w.call ' another'} + fs.write_file(@remote_file, true){|w| w.write ' another'} data = "" fs.read_file(@remote_file){|buff| data << buff} data.should == 'something another' end end it "delete_file" do @storage.open_fs do |fs| - fs.write_file(@remote_file, false){|w| w.call 'something'} + fs.write_file(@remote_file, false){|w| w.write 'something'} fs.attributes(@remote_file)[:file].should be_true fs.delete_file(@remote_file) fs.attributes(@remote_file).should == {} end end @@ -90,11 +90,11 @@ it 'should delete not-empty directories' do @storage.open_fs do |fs| fs.create_dir(@remote_dir) fs.create_dir("#{@remote_dir}/dir") - fs.write_file("#{@remote_dir}/dir/file", false){|w| w.call 'something'} + fs.write_file("#{@remote_dir}/dir/file", false){|w| w.write 'something'} fs.delete_dir(@remote_dir) fs.attributes(@remote_dir).should == {} end end @@ -104,10 +104,10 @@ fs.each_entry(@tmp_dir, nil){|path, type| list[path] = type} list.should be_empty dir, file = "#{@tmp_dir}/dir", "#{@tmp_dir}/file" fs.create_dir(dir) - fs.write_file(file, false){|w| w.call 'something'} + fs.write_file(file, false){|w| w.write 'something'} list = {} fs.each_entry(@tmp_dir, nil){|path, type| list[path] = type} list.should == {'dir' => :dir, 'file' => :file} end \ No newline at end of file