nspec / NSpec

A battle hardened testing framework for C# that's heavily inspired by Mocha and RSpec.

Home Page:http://nspec.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Details of inner exceptions are not displayed in console output

triangular-sneaky opened this issue · comments

Inner exception details for both example and context exceptions are ignored.

We might need to consider using (or mimic) Exception.ToString instead of outputting stack trace and message separately.

Reproduce (NSpec 3.0.7):

public class illustrate_ContextInnerExceptionLost : nspec
    {
        public void given_FailureWithInnerException ()
        {
            act = () => { throw new Exception("Ctx:Outer", new Exception("Ctx:Inner")); };

            it["should display both inner and outer"] = () => { throw new Exception("Example:Outer", new Exception("Example:Inner"));} ;
        }
    }

Actual: Ctx:Inner or Example:Inner don't appear in console output:

**** FAILURES ****
nspec. illustrate ContextInnerExceptionLost. given FailureWithInnerException. should display both inner and outer.
Context Failure: Ctx:Outer, Example Failure: Example:Outer
   at nspec_debug.illustrate_ContextInnerExceptionLost.<>c.<given_FailureWithInnerException>b__0_0() in C:\_dev\other\nspec-debug\illustrate_ContextInnerExceptionLost.cs:line 13

@Dpoznyak just to let you know I'm going to close this shortly for inactivity