ember-cli-version-checker
Advanced tools
Comparing version 1.1.1 to 1.1.2
11
index.js
@@ -57,6 +57,2 @@ 'use strict'; | ||
DependencyVersionChecker.prototype.satisfies = function satisfies(comparison) { | ||
return semver.satisfies(this.version, comparison); | ||
}; | ||
DependencyVersionChecker.prototype.isAbove = function isAbove(compareVersion) { | ||
@@ -66,2 +62,9 @@ return semver.satisfies(this.version, '>' + compareVersion); | ||
var semverMethods = ['gt', 'lt', 'satisfies']; | ||
semverMethods.forEach(function(method) { | ||
DependencyVersionChecker.prototype[method] = function(range) { | ||
return semver[method](this.version, range); | ||
}; | ||
}); | ||
DependencyVersionChecker.prototype.assertAbove = function assertAbove(compareVersion, _message) { | ||
@@ -68,0 +71,0 @@ var message = _message; |
{ | ||
"name": "ember-cli-version-checker", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Determine if your addon is being used by a minimum version of Ember CLI.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -80,7 +80,7 @@ var assert = require('assert'); | ||
describe('isAbove', function() { | ||
describe('gt', function() { | ||
it('returns true if version is above the specified range', function() { | ||
var thing = checker.for('ember', 'npm'); | ||
assert.equal(thing.isAbove('0.0.1'), true); | ||
assert.equal(thing.gt('0.0.1'), true); | ||
}); | ||
@@ -91,6 +91,20 @@ | ||
assert.equal(thing.isAbove('99.0.0'), false); | ||
assert.equal(thing.gt('99.0.0'), false); | ||
}); | ||
}); | ||
describe('lt', function() { | ||
it('returns false if version is above the specified range', function() { | ||
var thing = checker.for('ember', 'npm'); | ||
assert.equal(thing.lt('0.0.1'), false); | ||
}); | ||
it('returns true if version is below the specified range', function() { | ||
var thing = checker.for('ember', 'npm'); | ||
assert.equal(thing.lt('99.0.0'), true); | ||
}); | ||
}); | ||
describe('assertAbove', function() { | ||
@@ -97,0 +111,0 @@ it('throws an error with a default message if a matching version was not found', function() { |
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
14676
298