[CB-2213] Added tests for write and truncate.

Also added a method to clear the status before each test.