Skip to content

Commit

Permalink
Merge pull request #3 from carrot/tumblr-test
Browse files Browse the repository at this point in the history
add test case for jade + roots-tumblr compilation
  • Loading branch information
kylemac committed May 20, 2015
2 parents 7c3cca9 + c76adf5 commit 3c7612e
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 21 deletions.
37 changes: 19 additions & 18 deletions package.json
@@ -1,8 +1,11 @@
{
"name": "roots-inline-css",
"version": "0.0.1",
"description": "a roots extension for inlining your CSS properties into the style attribute in an html file",
"main": "lib",
"version": "0.0.1",
"author": "Carrot Creative",
"bugs": {
"url": "https://github.com/carrot/roots-inline-css/issues"
},
"dependencies": {
"bluebird": "^2.9.25",
"inline-css": "kylemac/inline-css",
Expand All @@ -15,28 +18,26 @@
"chai-fs": "0.1.x",
"coffee-script": "1.7.x",
"coveralls": "2.x",
"istanbul": "0.3.x",
"mocha": "2.x",
"roots": "3.0.x",
"istanbul": "0.3.x"
},
"scripts": {
"test": "./node_modules/.bin/mocha",
"coverage": "make build; NODE_ENV=test ./node_modules/.bin/istanbul cover ./node_modules/mocha/bin/_mocha; make unbuild; open coverage/lcov-report/index.html;",
"coveralls": "make build; make coveralls; make unbuild;"
},
"repository": {
"type": "git",
"url": "https://github.com/carrot/roots-inline-css.git"
"roots-tumblr": "0.0.x"
},
"homepage": "https://github.com/carrot/roots-inline-css",
"keywords": [
"rootsextension",
"roots",
"roots-ext"
"roots-ext",
"rootsextension"
],
"author": "Carrot Creative",
"license": "MIT",
"bugs": {
"url": "https://github.com/carrot/roots-inline-css/issues"
"main": "lib",
"repository": {
"type": "git",
"url": "https://github.com/carrot/roots-inline-css.git"
},
"homepage": "https://github.com/carrot/roots-inline-css"
"scripts": {
"coverage": "make build; NODE_ENV=test ./node_modules/.bin/istanbul cover ./node_modules/mocha/bin/_mocha; make unbuild; open coverage/lcov-report/index.html;",
"coveralls": "make build; make coveralls; make unbuild;",
"test": "./node_modules/.bin/mocha"
}
}
6 changes: 6 additions & 0 deletions test/fixtures/tumblr/app.coffee
@@ -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
@@ -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
@@ -0,0 +1,8 @@
{
"name": "test",
"dependencies": {
"jade": "*",
"stylus": "*",
"roots-tumblr": "*"
}
}
2 changes: 2 additions & 0 deletions test/fixtures/tumblr/style.styl
@@ -0,0 +1,2 @@
p
text-decoration: underline
15 changes: 12 additions & 3 deletions test/test.coffee
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 3c7612e

Please sign in to comment.