Jun 07

It’s Alive!!!

admin @ 12:23 am

sSpec is up & running under VisualWorks!

DO-ITing

TextSpecRunner verbose
	runAll: (OrderedCollection
		with: SampleContextWithFailingSpec new
		with: SampleContext new)

results in the following in the Transcript:

sample context with failing spec
	should fail (FAILED 1)
	should pass
sample context
	should be spec one
	should be spec two

2 contexts, 4 specs, 1 failures
0.044 seconds
1) ExpectationNotMetError in ' sample context with failing spec should fail'
should be even
SSpec.ShouldHelper(SSpec.ShouldBase)>>failWithMessage:

The code for the example specs is trivial, for example:

Smalltalk.SSpec defineClass: #SampleContextWithFailingSpec
	superclass: #{SSpec.SpecContext}
	indexedType: #none
	private: false
	instanceVariableNames: ''
	classInstanceVariableNames: ''
	imports: ''
	category: 'SSpec-Structural Tests'!

!SSpec.SampleContextWithFailingSpec methodsFor: 'specs'!

shouldFail
	5 should be even!

shouldPass
	5 should be odd! !

Sure, a few things need tweaking… and there needs to be a gui based runner, ability to debug a failing spec, etc. ( I want to hook into the sUnit browser integration :) )… but the core is up & running nicely. With a builtin rSpec-like Mock framework as well.
Tags: