Skip to content

Commit

Permalink
Merge pull request #10324 from ebryn/mand-set-in-prod-test
Browse files Browse the repository at this point in the history
Don’t run this mandatory setter test in prod
  • Loading branch information
ebryn committed Jan 31, 2015
2 parents 7b6f1e9 + 5625bbe commit ac07b27
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 ac07b27

Please sign in to comment.