forked from ricardobeat/cake-flour
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move adapter tests to separate files
- Loading branch information
1 parent
a92d5e2
commit d14a570
Showing
7 changed files
with
141 additions
and
117 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
flour = require '../../flour' | ||
should = require 'should' | ||
fs = require 'fs' | ||
|
||
flour.silent() | ||
|
||
describe 'CoffeeScript compiler', -> | ||
|
||
input_file = "#{dir.sources}/compile.coffee" | ||
output_file = "#{dir.temp}/compile.js" | ||
|
||
it 'should compile CoffeeScript and return the output', (done) -> | ||
flour.compile input_file, (output) -> | ||
output.should.include 'bacon = function' | ||
done() | ||
|
||
it 'should compile CoffeeScript to a file', (done) -> | ||
flour.compile input_file, output_file, -> | ||
readFile(output_file).should.include 'bacon = function' | ||
done() | ||
|
||
it 'should compile CoffeeScript to a file && return the output', (done) -> | ||
flour.compile input_file, output_file, (res) -> | ||
should.exist fs.existsSync output_file | ||
res.should.include 'bacon = function' | ||
done() |
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,37 @@ | ||
flour = require '../../flour' | ||
should = require 'should' | ||
|
||
flour.silent() | ||
|
||
describe 'LESS compiler', -> | ||
|
||
input_file = "#{dir.sources}/compile.less" | ||
output_file = "#{dir.temp}/compile.css" | ||
|
||
it 'should compile LESS and return the output', (done) -> | ||
flour.compile input_file, (output) -> | ||
output.should.include '.one .two' | ||
done() | ||
|
||
it 'should compile LESS to a file', (done) -> | ||
flour.compile input_file, output_file, -> | ||
readFile(output_file).should.include '.one .two{color' # compressed by default | ||
done() | ||
|
||
it 'should compile LESS to a file && return the output', (done) -> | ||
flour.compile input_file, output_file, (res) -> | ||
readFile(output_file).should.include '.one .two' | ||
res.should.include '.one .two' | ||
done() | ||
|
||
it 'should compile LESS with compression disabled', (done) -> | ||
flour.compilers.less.compress = false | ||
flour.compile input_file, (output) -> | ||
output.should.include '.one .two {\n color: #abcdef;\n}' | ||
done() | ||
|
||
it 'should compile LESS with yui compression enabled', (done) -> | ||
flour.compilers.less.yuicompress = true | ||
flour.compile input_file, (output) -> | ||
output.should.include '.one .two{color:#abcdef}' | ||
done() |
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,31 @@ | ||
flour = require '../../flour' | ||
should = require 'should' | ||
|
||
flour.silent() | ||
|
||
describe 'Stylus compiler', -> | ||
|
||
input_file = "#{dir.sources}/compile.styl" | ||
output_file = "#{dir.temp}/compile.css" | ||
|
||
it 'should compile Stylus and return the output', (done) -> | ||
flour.compile input_file, (output) -> | ||
output.should.include '.one .two' | ||
done() | ||
|
||
it 'should compile Stylus to a file', (done) -> | ||
flour.compile input_file, output_file, -> | ||
readFile(output_file).should.include '.one .two' | ||
done() | ||
|
||
it 'should compile Stylus to a file && return the output', (done) -> | ||
flour.compile input_file, output_file, (res) -> | ||
readFile(output_file).should.include '.one .two' | ||
res.should.include '.one .two' | ||
done() | ||
|
||
it 'should compile Stylus with compression disabled', (done) -> | ||
flour.compilers.styl.compress = false | ||
flour.compile input_file, (output) -> | ||
output.should.include '.one .two {\n color: #abcdef;\n}' | ||
done() |
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,19 @@ | ||
flour = require '../../flour' | ||
should = require 'should' | ||
|
||
flour.silent() | ||
|
||
describe 'CSS minifier', -> | ||
|
||
input_file = "#{dir.sources}/minify.css" | ||
output_file = "#{dir.temp}/minify.min.css" | ||
|
||
it 'should minify css and return the output', (done) -> | ||
flour.minify input_file, (output) -> | ||
output.should.include 'body,p{color:red}' | ||
done() | ||
|
||
it 'should minify css to a file', (done) -> | ||
flour.minify input_file, output_file, -> | ||
readFile(output_file).should.include 'body,p{color:red}' | ||
done() |
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,19 @@ | ||
flour = require '../../flour' | ||
should = require 'should' | ||
|
||
flour.silent() | ||
|
||
describe 'JS minifier', -> | ||
|
||
input_file = "#{dir.sources}/minify.js" | ||
output_file = "#{dir.temp}/minify.min.js" | ||
|
||
it 'should minify javascript and return the output', (done) -> | ||
flour.minify input_file, (output) -> | ||
output.should.include 'function test(){return' | ||
done() | ||
|
||
it 'should minify javascript to a file', (done) -> | ||
flour.minify input_file, output_file, -> | ||
readFile(output_file).should.include 'function test(){return' | ||
done() |