Skip to content

Commit

Permalink
add documentation for 'with fs mocked out'
Browse files Browse the repository at this point in the history
  • Loading branch information
gustav-olsen-groupone committed Jun 14, 2015
1 parent d61f3b1 commit 02f1877
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,24 @@ for a real life example of how it simplify your tests.
# Assertions
## `with fs mocked out`
Mocking out the filesystem for the rest of the rest of the duration of
the given call to unexpected.
```js
function fileContentCAPS(filename) {
var fileContent = fs.readFileSync(filename, 'utf-8');
return fileContent.toUpperCase();
}

expect('/data/foobar.txt', 'with fs mocked out', {
'/data': {
'foobar.txt': 'Hello world',
}
}, 'when passed as parameter to', fileContentCAPS, 'to equal', 'HELLO WORLD');
```
## `to be a (path|text file) satisfying`
Assert that the stats of a given path, or the stats, and the content,
Expand Down

0 comments on commit 02f1877

Please sign in to comment.