diff --git a/addon/test-helper/deprecation.js b/addon/test-helper/deprecation.js index 7fb0c52..c30c9b5 100644 --- a/addon/test-helper/deprecation.js +++ b/addon/test-helper/deprecation.js @@ -23,11 +23,12 @@ DeprecationAssert.prototype = { } var assertion = this; this.env.Ember.deprecate = function(msg, test) { - var pushDeprecation = typeof test === 'function' ? !test() : !test; + var resultOfTest = typeof test === 'function' ? test() : test; + var shouldDeprecate = !resultOfTest; assertion.actuals = assertion.actuals || []; - if (pushDeprecation) { - assertion.actuals.push([msg, test]); + if (shouldDeprecate) { + assertion.actuals.push([msg, resultOfTest]); } }; }, diff --git a/tests/unit/deprecation-test.js b/tests/unit/deprecation-test.js index e2cff3d..9552cc6 100644 --- a/tests/unit/deprecation-test.js +++ b/tests/unit/deprecation-test.js @@ -67,7 +67,7 @@ test('expectDeprecation fires when an expected deprecation does not pass for fun assertion.assert(); }); -test('expectDeprecation fires when an expected deprecation does not pass for functions', function(){ +test('expectDeprecation fires when an expected deprecation does pass for functions', function(){ expect(1); var Ember = { deprecate: function(){} }; @@ -77,7 +77,7 @@ test('expectDeprecation fires when an expected deprecation does not pass for fun window.expectDeprecation(); QUnit.ok = function(isOk){ - originalOk(!isOk); + originalOk(isOk); }; Ember.deprecate('some dep', function() {