assetgraph-sprite
Advanced tools
Comparing version 0.2.7 to 0.2.8
@@ -196,3 +196,3 @@ var _ = require('underscore'), | ||
}); | ||
if (relationSpriteInfo.noGroupSelector) { | ||
if (relationSpriteInfo.noGroupSelector || !spriteGroup.placeHolder) { | ||
// The user specified that this selector needs its own background-image/background | ||
@@ -199,0 +199,0 @@ // property pointing at the sprite rather than relying on the Html elements also being |
@@ -5,3 +5,3 @@ { | ||
"repository": "git://github.com/One-com/assetgraph-sprite.git", | ||
"version": "0.2.7", | ||
"version": "0.2.8", | ||
"maintainers": [ | ||
@@ -8,0 +8,0 @@ { |
@@ -7,5 +7,5 @@ var vows = require('vows'), | ||
vows.describe('Sprite background images').addBatch({ | ||
'After loading a test case with images and spriting instructions': { | ||
'After loading a simple test case with images and spriting instructions': { | ||
topic: function () { | ||
new AssetGraph({root: __dirname + '/spriteBackgroundImages'}).queue( | ||
new AssetGraph({root: __dirname + '/spriteBackgroundImages/simple/'}).queue( | ||
transforms.loadAssets('style.css'), | ||
@@ -38,3 +38,3 @@ transforms.populate() | ||
topic: function () { | ||
new AssetGraph({root: __dirname + '/spriteBackgroundImages'}).queue( | ||
new AssetGraph({root: __dirname + '/spriteBackgroundImages/simple/'}).queue( | ||
transforms.loadAssets('style.css'), | ||
@@ -58,3 +58,29 @@ transforms.populate(), | ||
} | ||
}, | ||
'After loading a simple test case with two background-images to be sprited, but with no group selector': { | ||
topic: function () { | ||
new AssetGraph({root: __dirname + '/spriteBackgroundImages/noGroupSelector/'}).queue( | ||
transforms.loadAssets('style.css'), | ||
transforms.populate() | ||
).run(this.callback); | ||
}, | ||
'the graph contains 2 Pngs': function (assetGraph) { | ||
assert.equal(assetGraph.findAssets({type: 'Png'}).length, 2); | ||
}, | ||
'then spriting the background images': { | ||
topic: function (assetGraph) { | ||
assetGraph.queue(require('../lib')()).run(this.callback); | ||
}, | ||
'the number of Png assets should be down to one': function (assetGraph) { | ||
assert.equal(assetGraph.findAssets({type: 'Png'}).length, 1); | ||
}, | ||
'the graph should contain 2 CssImage relations': function (assetGraph) { | ||
assert.equal(assetGraph.findRelations({type: 'CssImage'}).length, 2); | ||
}, | ||
'the stylesheet should have the expected contents': function (assetGraph) { | ||
assert.equal(assetGraph.findAssets({type: 'Css'})[0].text, | ||
'.icon-foo{background-image:url(20.png);background-position:0 0}.icon-bar{background-image:url(20.png);background-position:-12px 0}'); | ||
} | ||
} | ||
} | ||
})['export'](module); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32552
19
498