'use strict';

var sandboxFactory = require('..'),
    MemoryFS = require('memory-fs'),
    memoryFS = new MemoryFS(),
    sandbox = sandboxFactory.create(memoryFS);

memoryFS.mkdirpSync('/my/dir');
memoryFS.writeFileSync(
    '/my/dir/file1.js',
    'console.log("File1"); require("./file2.js"); console.log("Then"); require("/my/dir"); console.log("End");'
);
memoryFS.writeFileSync(
    '/my/dir/index.js',
    'console.log("Index");'
);
memoryFS.writeFileSync(
    '/my/dir/file2.js',
    'console.log("File2");'
);

sandbox.execute('require("/my/dir/file1");');

@@ -48,22 +48,20 @@
 '),%0A    
-Memory
+mock
 FS = req
@@ -71,47 +71,19 @@
 e('m
-emory-fs'),%0A    memoryFS = new MemoryFS
+ock-fs').fs
 (),%0A
@@ -123,33 +123,54 @@
 te(m
-emory
+ock
 FS);%0A%0Am
-emory
+ockFS.mkdirSync('/my');%0Amock
 FS.mkdir
 pSyn
@@ -169,9 +169,8 @@
 kdir
-p
 Sync
@@ -179,29 +179,27 @@
 /my/dir');%0Am
-emory
+ock
 FS.writeFile
@@ -336,37 +336,35 @@
 og(%22End%22);'%0A);%0Am
-emory
+ock
 FS.writeFileSync
@@ -425,13 +425,11 @@
 );%0Am
-emory
+ock
 FS.w

Switch demo to use mock-fs rather than memory-fs