[Seaside] sspec questions
cnantais at gmail.com
Tue Jan 8 08:43:17 UTC 2008
I've been using John's port for a little while now and it is working fine. I
just committed a change that adds #before and #after (like in RSpec) for
setup and teardown routines.
The next thing I'd like to see is being able to call #shouldReceive: on
objects and classes rather than just on mocks, as this fundamental
functionality already exists in RSpec. I am trying to add it right now, but
my brain just spins at this hour. Any volunteers?
John Thornborrow wrote:
> I recently made a fresh port of SSpec from VW and added some refinements
> to the mock object behaviour. This is available on Squeaksource.com ,
> however, you must not load the other packages, only the "SSpec" package,
> otherwise it may not work.
> To create your own SpecContext:
> Subclass SpecContext
> Create method category "specs"
> Only methods in the category named "specs" will be run as part of the
> spec, so you can use helper methods in other categories which will not
> A few examples of specs:
> 1 should equal: 1
> #(1 2 3 4 5) should include: 3
> [ #() first ] should raise: Error
> [ #(1) first ] should not raise: Error
> | mock |
> mock := self mock: 'A mock name'.
> (mock shouldReceive: #foo)
> andReturnConsecutively: #('foo' 'bar').
> SomeClass new on: mock; doSomething
> Finally, to run the spec using the text runner:
> TextSpecRunner verbose run: SampleContext. Transcript endEntry
> I've also, literally just this second, added a Morphic spec runner to
> the repository. (SSpec-jmt.11) It's quite primitive, but I find it very
> handy. :)
>  http://www.squeaksource.com/SSpec
> I hope this helps,
> itsme213 wrote:
>> Ah, I was looking for very similar RSpec-like facilities, but think some
>> them are not really needed (or are just not there). Would the following
>> correct for a simplified first-start at using SSpec (<..?..> is not clear
>> me, yet):
>> - define any (indirect) subclass of TestCase
>> - define a testXYZ method (or write class-side #suite methods)
>> - use sSpec protocols #should, Mock, #shouldReceive, etc.
>> - run as usual in TestRunner
>> - run in Refactoring or other Browser by <..?..>
>> - subclass SpecContext
>> - <..?..>
>> Corrections welcome.
>> "itsme213" <itsme213 at hotmail.com> wrote in message
>> news:ffu9hb$us8$1 at ger.gmane.org...
>>> I'm poking around with SSpec and can't figure out how to get started
>>> writing my first spec in Squeak. Basic stuff like
>>> - to make a dest case subclass XYZTestCase ...,
>>> - test a method category by ...
>>> - run your tests with a TextRunner by ... or in the Refactoring Browser
>>> by ...
>>> I have the current SSPec loaded (from Monticello), have SUnit-Improved
>>> etc. Astel's pdfs have not helped much. Any pointers?
>>> I have done some simple SUnit-based testing before.
>>> "Keith Hodges" <keith_hodges at yahoo.co.uk> wrote in message
>>> news:471EAD4E.1010006 at yahoo.co.uk...
>>>>> As far as graphical runners is concerned.... I spent a lot of time
>>>>> changing SUnit so that it might be compatible with SSpec, so that you
>>>>> can specify tests/specs based upon method category as sspec does.
>>>> I should mention that these changes are part of the SUnit-improved
>>>> package available from in the "development" package universe.
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
> Pinesoft Computers are registered in England, Registered number: 2914825.
> Registered office: 266-268 High Street, Waltham Cross, Herts, EN8 7EA
> This message has been scanned for viruses by BlackSpider MailControl -
> seaside mailing list
> seaside at lists.squeakfoundation.org
View this message in context: http://www.nabble.com/sspec-questions-tp13377818p14684987.html
Sent from the Squeak - Seaside mailing list archive at Nabble.com.
More information about the seaside