Skip to content

Instantly share code, notes, and snippets.

@radmen
Created June 10, 2014 13:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save radmen/617cecb0c7399b7d1ff4 to your computer and use it in GitHub Desktop.
Save radmen/617cecb0c7399b7d1ff4 to your computer and use it in GitHub Desktop.
gulp-order modified test case
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