spec/filesystem_spec.rb in libuv-0.10.2 vs spec/filesystem_spec.rb in libuv-0.10.3
- old
+ new
@@ -15,13 +15,13 @@
end
@timeout.start(4000)
@logger = proc { |level, errorid, error|
begin
- p "Log called: #{level}: #{errorid}\n#{error.message}\n#{error.backtrace.join("\n")}\n"
+ @general_failure << "Log called: #{level}: #{errorid}\n#{error.message}\n#{error.backtrace.join("\n")}\n"
rescue Exception
- p 'error in logger'
+ @general_failure << 'error in logger'
end
}
@thefile = "test-file.txt"
@@ -104,12 +104,17 @@
it "should delete a file" do
@loop.run { |logger|
logger.progress &@logger
- @loop.filesystem.unlink(@thefile).then do
+ op = @loop.filesystem.unlink(@thefile)
+ op.then do
@loop.stop
@log = :success
+ end
+ op.catch do |error|
+ @general_failure << error
+ @loop.stop
end
}
@general_failure.should == []
@log.should == :success