Skip to content

Commit

Permalink
Don’t run this mandatory setter test in prod
Browse files Browse the repository at this point in the history
  • Loading branch information
ebryn committed Jan 31, 2015
1 parent 422c626 commit 5625bbe
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions packages/ember-runtime/tests/system/object/destroy_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,26 @@ testBoth("should schedule objects to be destroyed at the end of the run loop", f
ok(get(obj, 'isDestroyed'), "object is destroyed after run loop finishes");
});

if (hasPropertyAccessors) {
// MANDATORY_SETTER moves value to meta.values
// a destroyed object removes meta but leaves the accessor
// that looks it up
test("should raise an exception when modifying watched properties on a destroyed object", function() {
var obj = EmberObject.createWithMixins({
foo: "bar",
fooDidChange: observer('foo', function() { })
if (Ember.FEATURES.isEnabled('mandatory-setter')) {
if (hasPropertyAccessors) {
// MANDATORY_SETTER moves value to meta.values
// a destroyed object removes meta but leaves the accessor
// that looks it up
test("should raise an exception when modifying watched properties on a destroyed object", function() {
var obj = EmberObject.createWithMixins({
foo: "bar",
fooDidChange: observer('foo', function() { })
});

run(function() {
obj.destroy();
});

raises(function() {
set(obj, 'foo', 'baz');
}, Error, "raises an exception");
});

run(function() {
obj.destroy();
});

raises(function() {
set(obj, 'foo', 'baz');
}, Error, "raises an exception");
});
}
}

test("observers should not fire after an object has been destroyed", function() {
Expand Down

0 comments on commit 5625bbe

Please sign in to comment.