Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don’t run this mandatory setter test in prod #10324

Merged
merged 1 commit into from
Jan 31, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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