• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

[Test(expects="Error")] not functioning as expected

Guest
Jun 11, 2009 Jun 11, 2009

Copy link to clipboard

Copied

When testing against implementation code which is expected to throw an exception the test fails even when the expected exception is thrown.

I broke this test down into a very simple example to help illustrate the issue:

public class ExpectsExampleTest
{
    [Test(expects="Error")]
    public function testExpects():void
    {
        throw new Error();
    }
}

The above code result in the following error:

6/11/2009 23:23:39.519 [WARN] FlexUnit4 There was 1 failure:
6/11/2009 23:23:39.522 [WARN] FlexUnit4 1 tests::ExpectsExampleTest.testExpects Error

Not sure if I am missing something or not, however the implementation appears to be correct.

Thanks,

Eric

TOPICS
FlexUnit

Views

3.4K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jun 11, 2009 Jun 11, 2009

Copy link to clipboard

Copied

Eric,

there was a bug surrounding this issue. Latest bits in SVN should have it corrected. There was a difference between the docs and code.

if you get the latest, it will work as is, or, you can change the word expects to expected and it will likely work in yours.

It the new version it accepts either,

Mike

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 18, 2010 Oct 18, 2010

Copy link to clipboard

Copied

LATEST

mlabriola wrote:

Eric,

there was a bug surrounding this issue. Latest bits in SVN should have it corrected. There was a difference between the docs and code.

if you get the latest, it will work as is, or, you can change the word expects to expected and it will likely work in yours.

It the new version it accepts either,

Mike

thanks mike, you're right

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines