Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
72 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
numbers = [1,2,3,4] | ||
|
||
console.log i for i in numbers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
numbers = [1,2,3,4] | ||
|
||
console.log i for i in numbers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
letters = ['a','b','c','d','e', 'x'] | ||
|
||
console.log i for i in letters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
letters2 = ['x','y','z'] | ||
|
||
console.log i for i in letters2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
assert = require 'assert' | ||
fs = require 'fs' | ||
path = require 'path' | ||
coffeebar = require '../lib/coffeebar' | ||
|
||
fixturePath = path.join __dirname, 'fixtures/output' | ||
|
||
inputFile = path.join fixturePath, 'input.coffee' | ||
outputFile = path.join fixturePath, 'input.js' | ||
inputDir = path.join fixturePath, 'input' | ||
outputDir = path.join fixturePath, 'output' | ||
|
||
files = [ | ||
"numbers.js" | ||
"sub/letters.js" | ||
"sub/subsub/letters2.js" | ||
] | ||
|
||
describe 'Output', -> | ||
|
||
before -> | ||
try fs.unlinkSync outputFile | ||
|
||
it 'should write to the same directory', -> | ||
coffeebar inputFile | ||
assert fs.existsSync outputFile | ||
|
||
it 'should write from an input dir to an output dir', -> | ||
coffeebar inputDir, {output: outputDir} | ||
for file in files | ||
assert fs.existsSync path.join(outputDir, file) | ||
|
||
it 'should write from an input file to an output dir', -> | ||
coffeebar inputFile, {output: outputDir} | ||
assert fs.existsSync path.join(outputDir, "input.js") | ||
|
||
after -> | ||
try fs.unlinkSync outputFile | ||
try fs.unlinkSync path.join(outputDir, "input.js") | ||
for file in files | ||
try fs.unlinkSync path.join(outputDir, file) |