Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Don't try to fingerprint bundles when the option is disabled

  • Loading branch information...
commit 8b0629ca6aab811807bb6d42042f4bc9009165ac 1 parent 5584af5
@laktek authored
Showing with 5 additions and 21 deletions.
  1. +4 −2 lib/asset_bundler.js
  2. +1 −19 spec/asset_bundler.spec.js
View
6 lib/asset_bundler.js
@@ -269,7 +269,9 @@ module.exports = {
var bundle_path = params[0] + params[1];
// create the fingerprinted bundle
- self.fingerprintBundle(bundle_path, after);
+ if (self.bundleOptions.fingerprint) {
+ self.fingerprintBundle(bundle_path, after);
+ }
// set the bundle path only if the bundle is modified.
// this is to let generator hooks to skip the callback if path is null.
@@ -291,7 +293,7 @@ module.exports = {
fingerprintBundle: function(bundle_path, callback) {
var self = this;
- if (!bundle_path || !self.bundleOptions.fingerprint) {
+ if (!bundle_path) {
return callback();
}
View
20 spec/asset_bundler.spec.js
@@ -537,6 +537,7 @@ describe("touch bundles", function() {
});
it("fingerprint bundle with the touched bundle path", function() {
+ asset_bundler.bundleOptions.fingerprint = true;
asset_bundler.bundles = sample_bundles;
spyOn(asset_bundler, "getBundle").andCallFake(function(basename, type, options, callback) {
@@ -575,26 +576,13 @@ describe("touch bundles", function() {
describe("fingerprint a bundle", function() {
it("halt if no bundle path given", function() {
- asset_bundler.bundleOptions.fingerprint = true;
-
var spyCallback = jasmine.createSpy();
asset_bundler.fingerprintBundle(null, spyCallback);
expect(spyCallback).toHaveBeenCalled();
});
- it("halt if fingerprinting option is not enabled", function() {
- asset_bundler.bundleOptions.fingerprint = false;
-
- var spyCallback = jasmine.createSpy();
- asset_bundler.fingerprintBundle("path/test.js", spyCallback);
-
- expect(spyCallback).toHaveBeenCalled();
- });
-
it("take the stat of the bundle", function() {
- asset_bundler.bundleOptions.fingerprint = true;
-
spyOn(asset_bundler, "statBundle");
var spyCallback = jasmine.createSpy();
@@ -604,8 +592,6 @@ describe("fingerprint a bundle", function() {
});
it("get the bundle from the cache", function() {
- asset_bundler.bundleOptions.fingerprint = true;
-
spyOn(asset_bundler, "statBundle").andCallFake(function(basename, extension, callback) {
return callback(null, { "mtime": new Date(2012, 10, 8) });
});
@@ -620,8 +606,6 @@ describe("fingerprint a bundle", function() {
});
it("add the fingereprinted bundle to the cache", function() {
- asset_bundler.bundleOptions.fingerprint = true;
-
var spyBundleContent = jasmine.createSpy();
spyOn(asset_bundler, "statBundle").andCallFake(function(basename, extension, callback) {
@@ -642,8 +626,6 @@ describe("fingerprint a bundle", function() {
});
it("call the callback function with the fingerprinted bundle path", function() {
- asset_bundler.bundleOptions.fingerprint = true;
-
var spyBundleContent = jasmine.createSpy();
spyOn(asset_bundler, "statBundle").andCallFake(function(basename, extension, callback) {
Please sign in to comment.
Something went wrong with that request. Please try again.