Skip to content

Instantly share code, notes, and snippets.

@sebgie
Created January 24, 2014 10:17
Show Gist options
  • Save sebgie/8594971 to your computer and use it in GitHub Desktop.
Save sebgie/8594971 to your computer and use it in GitHub Desktop.
@@ -86,13 +86,14 @@ describe('Local File System Storage', function () {
it('can upload two different images with the same name without overwriting the first', function (done) {
// Sun Sep 08 2013 10:57
this.clock = sinon.useFakeTimers(new Date(2013, 8, 8, 10, 57).getTime());
- fs.exists.withArgs('content/images/2013/Sep/IMAGE.jpg').yields(true);
- fs.exists.withArgs('content/images/2013/Sep/IMAGE-1.jpg').yields(false);
+
+ fs.exists.withArgs(path.resolve('./content/images/2013/Sep/IMAGE.jpg')).yields(true);
+ fs.exists.withArgs(path.resolve('./content/images/2013/Sep/IMAGE-1.jpg')).yields(false);
// if on windows need to setup with back slashes
// doesn't hurt for the test to cope with both
- fs.exists.withArgs('content\\images\\2013\\Sep\\IMAGE.jpg').yields(true);
- fs.exists.withArgs('content\\images\\2013\\Sep\\IMAGE-1.jpg').yields(false);
+ fs.exists.withArgs(path.resolve('.\\content\\images\\2013\\Sep\\IMAGE.jpg')).yields(true);
+ fs.exists.withArgs(path.resolve('.\\content\\images\\2013\\Sep\\IMAGE-1.jpg')).yields(false);
localfilesystem.save(image).then(function (url) {
url.should.equal('/content/images/2013/Sep/IMAGE-1.jpg');
@@ -103,18 +104,18 @@ describe('Local File System Storage', function () {
it('can upload five different images with the same name without overwriting the first', function (done) {
// Sun Sep 08 2013 10:57
this.clock = sinon.useFakeTimers(new Date(2013, 8, 8, 10, 57).getTime());
- fs.exists.withArgs('content/images/2013/Sep/IMAGE.jpg').yields(true);
- fs.exists.withArgs('content/images/2013/Sep/IMAGE-1.jpg').yields(true);
- fs.exists.withArgs('content/images/2013/Sep/IMAGE-2.jpg').yields(true);
- fs.exists.withArgs('content/images/2013/Sep/IMAGE-3.jpg').yields(true);
- fs.exists.withArgs('content/images/2013/Sep/IMAGE-4.jpg').yields(false);
+ fs.exists.withArgs(path.resolve('./content/images/2013/Sep/IMAGE.jpg')).yields(true);
+ fs.exists.withArgs(path.resolve('./content/images/2013/Sep/IMAGE-1.jpg')).yields(true);
+ fs.exists.withArgs(path.resolve('./content/images/2013/Sep/IMAGE-2.jpg')).yields(true);
+ fs.exists.withArgs(path.resolve('./content/images/2013/Sep/IMAGE-3.jpg')).yields(true);
+ fs.exists.withArgs(path.resolve('./content/images/2013/Sep/IMAGE-4.jpg')).yields(false);
// windows setup
- fs.exists.withArgs('content\\images\\2013\\Sep\\IMAGE.jpg').yields(true);
- fs.exists.withArgs('content\\images\\2013\\Sep\\IMAGE-1.jpg').yields(true);
- fs.exists.withArgs('content\\images\\2013\\Sep\\IMAGE-2.jpg').yields(true);
- fs.exists.withArgs('content\\images\\2013\\Sep\\IMAGE-3.jpg').yields(true);
- fs.exists.withArgs('content\\images\\2013\\Sep\\IMAGE-4.jpg').yields(false);
+ fs.exists.withArgs(path.resolve('.\\content\\images\\2013\\Sep\\IMAGE.jpg')).yields(true);
+ fs.exists.withArgs(path.resolve('.\\content\\images\\2013\\Sep\\IMAGE-1.jpg')).yields(true);
+ fs.exists.withArgs(path.resolve('.\\content\\images\\2013\\Sep\\IMAGE-2.jpg')).yields(true);
+ fs.exists.withArgs(path.resolve('.\\content\\images\\2013\\Sep\\IMAGE-3.jpg')).yields(true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment