TestWriteableOK asserts that Writeable returns the appropriate cheatpath when a writeable cheatpath exists
(t *testing.T)
| 7 | // TestWriteableOK asserts that Writeable returns the appropriate cheatpath |
| 8 | // when a writeable cheatpath exists |
| 9 | func TestWriteableOK(t *testing.T) { |
| 10 | |
| 11 | // initialize some cheatpaths |
| 12 | cheatpaths := []Path{ |
| 13 | Path{Path: "/foo", ReadOnly: true}, |
| 14 | Path{Path: "/bar", ReadOnly: false}, |
| 15 | Path{Path: "/baz", ReadOnly: true}, |
| 16 | } |
| 17 | |
| 18 | // get the writeable cheatpath |
| 19 | got, err := Writeable(cheatpaths) |
| 20 | |
| 21 | // assert that no errors were returned |
| 22 | if err != nil { |
| 23 | t.Errorf("failed to get cheatpath: %v", err) |
| 24 | } |
| 25 | |
| 26 | // assert that the path is correct |
| 27 | if got.Path != "/bar" { |
| 28 | t.Errorf("incorrect cheatpath returned: got: %s", got.Path) |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | // TestWriteableOK asserts that Writeable returns an error when no writeable |
| 33 | // cheatpaths exist |
nothing calls this directly
no test coverage detected