Created
June 10, 2014 13:30
-
-
Save radmen/617cecb0c7399b7d1ff4 to your computer and use it in GitHub Desktop.
gulp-order modified test case
This file contains hidden or 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
order = require "../src" | |
path = require "path" | |
{ File } = require "gulp-util" | |
{ expect } = require "chai" | |
require "mocha" | |
newFile = (filepath, base) -> | |
cwd = "/home/johndoe/" | |
unless base | |
base = cwd | |
new File | |
path: path.join(base, filepath) | |
base: base | |
cwd: cwd | |
contents: new Buffer("") | |
describe "gulp-order", -> | |
describe "order()", -> | |
it "should order files with globs", (done) -> | |
stream = order(['app/stylesheets/main.css', 'app/stylesheets/**']) | |
files = [] | |
stream.on "data", files.push.bind(files) | |
stream.on "end", -> | |
expect(files.length).to.equal 2 | |
expect(files[0].path).to.equal "app/stylesheets/main.css" | |
expect(files[1].path).to.equal "app/stylesheets/a.css" | |
done() | |
stream.write newFile("a.css", "app/stylesheets/") | |
stream.write newFile("main.css", "app/stylesheets/") | |
stream.end() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment