diff --git a/spec/atom-spec.coffee b/spec/atom-spec.coffee index 15af4ad50..c8c4a598f 100644 --- a/spec/atom-spec.coffee +++ b/spec/atom-spec.coffee @@ -151,7 +151,8 @@ describe "the `atom` global", -> describe "if the condition is false", -> it "notifies onDidFailAssertion handlers with an error object based on the call site of the assertion", -> - atom.assert(false, "a == b") + result = atom.assert(false, "a == b") + expect(result).toBe false expect(errors.length).toBe 1 expect(errors[0].message).toBe "Assertion failed: a == b" expect(errors[0].stack).toContain('atom-spec') @@ -170,7 +171,8 @@ describe "the `atom` global", -> describe "if the condition is true", -> it "does nothing", -> - atom.assert(true, "a == b") + result = atom.assert(true, "a == b") + expect(result).toBe true expect(errors).toEqual [] describe "saving and loading", -> diff --git a/src/atom.coffee b/src/atom.coffee index 4af35a91e..209a39e9c 100644 --- a/src/atom.coffee +++ b/src/atom.coffee @@ -715,7 +715,7 @@ class Atom extends Model ### assert: (condition, message, metadata) -> - return if condition + return true if condition error = new Error("Assertion failed: " + message) Error.captureStackTrace(error, @assert) @@ -728,6 +728,8 @@ class Atom extends Model @emitter.emit 'did-fail-assertion', error + false + deserializeProject: -> Project = require './project'