Skip to content

Commit

Permalink
add test case for jade + roots-tumblr compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle MacDonald committed May 20, 2015
1 parent 05f5604 commit c76adf5
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 3 deletions.
6 changes: 6 additions & 0 deletions test/fixtures/tumblr/app.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
rootsInlineCss = require '../../..'
tumblr = require 'roots-tumblr'

module.exports =
ignores: ["**/_*", "**/.DS_Store"]
extensions: [tumblr(), rootsInlineCss()]
8 changes: 8 additions & 0 deletions test/fixtures/tumblr/index.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
html
head
style.
p { color: red; }
link(rel='stylesheet', href='style.css')
title {Title}
body
p Test
8 changes: 8 additions & 0 deletions test/fixtures/tumblr/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "test",
"dependencies": {
"jade": "*",
"stylus": "*",
"roots-tumblr": "*"
}
}
2 changes: 2 additions & 0 deletions test/fixtures/tumblr/style.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
p
text-decoration: underline
15 changes: 12 additions & 3 deletions test/test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ before (done) ->
h.project.remove_folders('**/public')
h.project.install_dependencies('*', done)

after ->
h.project.remove_folders('**/public')

describe 'roots compile with inline-css', ->

before (done) -> compile_fixture.call(@, 'basic', done)
Expand Down Expand Up @@ -81,3 +78,15 @@ describe 'inline-css tested with the file option', ->
contents = fs.readFileSync(p, 'utf8')
contents.should.match /{ color: red; }/
done()

describe 'inline-css together with jade + roots-tumblr', ->
before (done) -> compile_fixture.call(@, 'tumblr', done)

it 'compiles the project', (done) ->
test = path.join(@public,'index.html')
test.should.be.a.file()
fs.existsSync(test).should.be.ok
contents = fs.readFileSync(test, 'utf8')
contents.should.match /<p style="color: red; text-decoration: underline;">/
contents.should.match(/<title>Untitled<\/title>/)
done()

0 comments on commit c76adf5

Please sign in to comment.