TestWriteableOK asserts that Writeable returns an error when no writeable cheatpaths exist
(t *testing.T)
| 32 | // TestWriteableOK asserts that Writeable returns an error when no writeable |
| 33 | // cheatpaths exist |
| 34 | func TestWriteableNotOK(t *testing.T) { |
| 35 | |
| 36 | // initialize some cheatpaths |
| 37 | cheatpaths := []Path{ |
| 38 | Path{Path: "/foo", ReadOnly: true}, |
| 39 | Path{Path: "/bar", ReadOnly: true}, |
| 40 | Path{Path: "/baz", ReadOnly: true}, |
| 41 | } |
| 42 | |
| 43 | // get the writeable cheatpath |
| 44 | _, err := Writeable(cheatpaths) |
| 45 | |
| 46 | // assert that no errors were returned |
| 47 | if err == nil { |
| 48 | t.Errorf("failed to return an error when no writeable paths found") |
| 49 | } |
| 50 | } |
nothing calls this directly
no test coverage detected