(t *testing.T)
| 34 | } |
| 35 | |
| 36 | func TestFileSystem_Open_err(t *testing.T) { |
| 37 | testError := errors.New("mock") |
| 38 | mockFS := &mockFileSystem{ |
| 39 | open: func(_ string) (http.File, error) { |
| 40 | return nil, testError |
| 41 | }, |
| 42 | } |
| 43 | fs := &FileSystem{mockFS} |
| 44 | |
| 45 | file, err := fs.Open("foo") |
| 46 | |
| 47 | require.ErrorIs(t, err, testError) |
| 48 | assert.Nil(t, file) |
| 49 | } |