[Rspec-devel] Failure messages - customize per "should"assertion

Keith Hodges Keith.Hodges at warwick.ac.uk
Sun May 28 20:08:31 EDT 2006


Dear "itsme",

In my experimental javascript adaptation of rspec I included the ability 
to construct and dissect contexts. I particularly like the ability to 
use a context up to a specified point. I think it may improve clarity 
and reduce repeated code but I have not had any feedback on this as yet 
so I would be interested to hear what you think.

Keith

original message follows:
> I have added a couple of experimental features to spec.js and I wondered 
> what you thought (given that Dave's previous feedback had such a radical 
> impact last time around)
>
> 1. in a context setUp function any calls to other contexts invoke their 
> setUp function too. This allows a context to call other contexts.
>
> e.g.
>
> context("A stack with one item").setUp= function() 
> 	{
> 		context("A new stack")
> 		stack.push( "one item" )
> 	}
>
> -----
>
> 2. allow a context to include markPointWhere( ) items. e.g.
>
> define context like so:
>
> context( "typical stack use" ).setUp= function()
> {
>     stack= new Stack()
>     markPointWhere( 'stack instanciated' )
>   
>     stack.push( 'one item' )
>     markPointWhere( one item is pushed onto empty stack )
> }
>
> use like so:
>
> context( "typical stack use", "stack instanciated" )
>
> or even perhaps:
>
> context( "typical stack use, to point where, stack instanciated" )
>
> ---
>
> any thoughts?
>
> Keith
>   
Send instant messages to your online friends http://uk.messenger.yahoo.com 



More information about the Rspec-devel mailing list