[Rspec-devel] Given, When, Then

Alvin Schur aschur1 at telus.net
Mon Aug 14 21:58:35 EDT 2006


On Friday 11 August 2006 07:08, aslak hellesoy wrote:
>
> > Is internationalization allowed?
> >
> > contexte, specifique; and if I could find the accent aigu it would look
> > like French.
>
> Malheureusement pas. Inside RSpec, context and specify are method
> definitions, and Ruby doesn't allow accents here.
>
Is it possible to override Kernel::require?

The new implementation of require can convert accents and keywords (then) to 
something more palatable to ruby before passing the file on to the original 
require method.

> > Changing terminology from "test" to "specification" changes thought
> > processes, but does it change the underlying semantics or implementation?
>
> Implementation of what? RSpec never used "test"
I see the difference between TDD and BDD as a change in terminology.  Both 
approaches appear to use the same semantics:

1) prepare the system under test
2) activate the system under test
3) verify facts about the system under test
4) clean up after the system under test

Are there any other semantic descriptions that make sense?

One option suggested on the list was a "story"

1) prepare the system under test
2) activate the system under test
3) verify facts about the system under test
x) repeat 2 and 3 as desired
4) clean up after the system under test

With a separation of terminology (DSL) and semantics perhaps RSpec can have 
plugins for semantics and map terminology to various semantic concepts.

BDD context / specify
setup -> 1
specify -> 2 and 3
teardown -> 4

TDD
setup -> 1
test_ -> 2 and 3
teardown -> 4

BDD given when then
given -> 1
when -> 2
then -> 3
teardown? -> 4

BDD story-arc
prelude/preface/introduction -> 1
episode-> 2
climax -> 3
(repeat above as desired)
epilogue / denouement -> 4


Alvin.


More information about the Rspec-devel mailing list