Skip to content
This repository has been archived by the owner on Nov 11, 2017. It is now read-only.

Properly expectDeprecation when test parameter is a function #153

Merged
merged 1 commit into from
Jun 12, 2015

Commits on Jun 12, 2015

  1. Properly expectDeprecation when test parameter is a function

    `Ember.deprecate` is called with `(message, test, options)`. When
    `test` is falsy or a function that evaluates to falsy, the deprecation
    is issued.
    
    `expectDeprecation` was correctly evaluating the `test` param when it is
    a function, but not pushing the correct result of that function into
    `actuals`. This made using `expectDeprecate` fail for a deprecation that used
    a test function.
    
    Example:
    
    ```
    // Ember code
    function foo() {
      Ember.deprecate('message', function() { return false; });
    }
    
    // test code -- this test would erroneously fail because
    // expectDeprecation pushes ['message', function() { return false; }]
    // onto actuals instead of ['message', false]
    expectDeprecation(function() {
      foo();
    }, 'message');
    ```
    bantic committed Jun 12, 2015
    Configuration menu
    Copy the full SHA
    9b2cf9b View commit details
    Browse the repository at this point in the history