::xoexception::test
Class TestExtractMessage

Heritage:
::xotcl::Object
  |
  +--::xox::Node
        |
        +--::xounit::Test
              |
              +--::xounit::Assert
                    |
                    +--::xounit::TestCase
Class TestExtractMessage
superclass ::xounit::TestCase,

Variables
NameDefault ValueClassComment
currentTestMethod    ::xounit::TestCase
 name of the currently running test method.
nodeName    ::xox::Node
 
result    ::xounit::TestCase
 the result for the current run.
 
Methods
NameComment
testExtractMessageFromException {}  
testExtractMessageFromTclErrorString {}  
   
Methods from ::xotcl::Object
#, ., ?, ?code, ?methods, ?object, abstract, copy, coverageFilter, defaultmethod, extractConfigureArg, filterappend, garbageCollect, get#, getClean#, hasclass, init, methodTag, mixinappend, move, profileFilter, self, setParameterDefaults, shell, tclcmd, traceFilter,
 
Instproc Detail

testExtractMessageFromException

Description:
 
Code:
  ::xoexception::test::TestExtractMessage instproc testExtractMessageFromException {}  {
   

    ::xoexception::try {

        error [ ::xoexception::Exception new "Exception message" ]

    } catch { ::xoexception::Exception result  } {

    }

    set message [ ::xoexception::Throwable extractMessage $result ]

    ::xotcl::my assertEquals $message "Exception message"

}

testExtractMessageFromTclErrorString

Description:
 
Code:
  ::xoexception::test::TestExtractMessage instproc testExtractMessageFromTclErrorString {}  {
   

    catch {

        error "Simple error"

    } result
    
    set message [ ::xoexception::Throwable extractMessage $result ]

    ::xotcl::my assertEquals $message "Simple error"

}