Thanks for the feedback, Piotr. I added a message to the assertTrue call (see my commit just a few minutes ago).
However, from what I can tell there's nothing I can check for in assertTrue, because I just want to make sure that no fatal error has been thrown, which validates that the bug is not there anymore. Without the fix I implemented, the fatal error is thrown during the execution of the unit test, which makes it fail. If you have any ideas on what else I could check, do let me know. On 16 January 2015 at 15:08, Piotr Zarzycki <piotrzarzyck...@gmail.com> wrote: > Hi Mihai, > > I would like to suggest add to asserTrue some information what has > happened. :) > I think it is a good practice add message to assert. > > Thanks, > Piotr > > > 2015-01-15 18:13 GMT+01:00 <mih...@apache.org>: > >> FLEX-34717 Added the same unit test and fix as for SpellingUIEx. >> >> >> Project: http://git-wip-us.apache.org/repos/asf/flex-utilities/repo >> Commit: >> http://git-wip-us.apache.org/repos/asf/flex-utilities/commit/da3883b7 >> Tree: http://git-wip-us.apache.org/repos/asf/flex-utilities/tree/da3883b7 >> Diff: http://git-wip-us.apache.org/repos/asf/flex-utilities/diff/da3883b7 >> >> Branch: refs/heads/develop >> Commit: da3883b76506682b96438d61946c9ce292919135 >> Parents: 9f2ef2b >> Author: Mihai Chira <mih...@apache.org> >> Authored: Thu Jan 15 17:03:54 2015 +0000 >> Committer: Mihai Chira <mih...@apache.org> >> Committed: Thu Jan 15 17:03:54 2015 +0000 >> >> ---------------------------------------------------------------------- >> .../com/adobe/linguistics/spelling/SpellUI.as | 12 ++++- >> .../linguistics/spelling/FLEX_34717_Test.as | 57 ++++++++++++++++++++ >> 2 files changed, 67 insertions(+), 2 deletions(-) >> ---------------------------------------------------------------------- >> >> >> >> http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/da3883b7/Squiggly/main/SpellingUI/src/com/adobe/linguistics/spelling/SpellUI.as >> ---------------------------------------------------------------------- >> diff --git >> a/Squiggly/main/SpellingUI/src/com/adobe/linguistics/spelling/SpellUI.as >> b/Squiggly/main/SpellingUI/src/com/adobe/linguistics/spelling/SpellUI.as >> index b697317..6da4ac1 100644 >> --- >> a/Squiggly/main/SpellingUI/src/com/adobe/linguistics/spelling/SpellUI.as >> +++ >> b/Squiggly/main/SpellingUI/src/com/adobe/linguistics/spelling/SpellUI.as >> @@ -546,8 +546,16 @@ package com.adobe.linguistics.spelling >> * @private >> */ >> private function cleanUp():void { >> - hh.clearSquiggles(); >> - scm.cleanUp(); >> + if(hh != null) >> + { >> + hh.clearSquiggles(); >> + } >> + >> + if(scm) >> + { >> + scm.cleanUp(); >> + } >> + >> >> _actualParent.removeEventListener(Event.ADDED_TO_STAGE, addContextMenu); >> >> mTextField.removeEventListener(ScrollEvent.SCROLL, >> spellCheckScreen); >> >> >> http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/da3883b7/Squiggly/main/SpellingUI/tests/com/adobe/linguistics/spelling/FLEX_34717_Test.as >> ---------------------------------------------------------------------- >> diff --git >> a/Squiggly/main/SpellingUI/tests/com/adobe/linguistics/spelling/FLEX_34717_Test.as >> b/Squiggly/main/SpellingUI/tests/com/adobe/linguistics/spelling/FLEX_34717_Test.as >> new file mode 100644 >> index 0000000..4d6a357 >> --- /dev/null >> +++ >> b/Squiggly/main/SpellingUI/tests/com/adobe/linguistics/spelling/FLEX_34717_Test.as >> @@ -0,0 +1,57 @@ >> >> +//////////////////////////////////////////////////////////////////////////////// >> +// >> +// Licensed to the Apache Software Foundation (ASF) under one or more >> +// contributor license agreements. See the NOTICE file distributed with >> +// this work for additional information regarding copyright ownership. >> +// The ASF licenses this file to You under the Apache License, Version >> 2.0 >> +// (the "License"); you may not use this file except in compliance with >> +// the License. You may obtain a copy of the License at >> +// >> +// http://www.apache.org/licenses/LICENSE-2.0 >> +// >> +// Unless required by applicable law or agreed to in writing, software >> +// distributed under the License is distributed on an "AS IS" BASIS, >> +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or >> implied. >> +// See the License for the specific language governing permissions and >> +// limitations under the License. >> +// >> >> +//////////////////////////////////////////////////////////////////////////////// >> + >> +package com.adobe.linguistics.spelling { >> + import com.adobe.linguistics.spelling.SpellUI; >> + >> + import mx.controls.TextArea; >> + >> + import org.flexunit.asserts.assertTrue; >> + import org.fluint.uiImpersonation.UIImpersonator; >> + >> + public class FLEX_34717_Test { >> + private var _input:TextArea; >> + >> + [Before] >> + public function setUp():void >> + { >> + _input = new TextArea(); >> + } >> + >> + [After] >> + public function tearDown():void >> + { >> + _input = null; >> + } >> + >> + [Test] >> + public function test_immediate_disable_after_enable():void >> + { >> + //given >> + UIImpersonator.addChild(_input); >> + >> + //when >> + SpellUI.enableSpelling(_input, "en_US"); >> + SpellUI.disableSpelling(_input); >> + >> + //then >> + assertTrue(true); //no error was thrown >> + } >> + } >> +} >> >> > > > -- > > Greetings > Piotr Zarzycki > > Flex/AIR/AngularJS Developer > > mobile: +48 880 859 557 > e-mail: piotrzarzyck...@gmail.com > skype: zarzycki10 > > LinkedIn: http://www.linkedin.com/piotrzarzycki <http://linkd.in/1aGNqao>