[rspec-devel] Stories in other languages

Fernando García Samblas fernando.garcia at the-cocktail.com
Fri Feb 1 15:43:08 EST 2008


Hello,

I've just subscribed to the RSpec lists and first of all I'd like to
thank you all for such a great work. I'm really having a great time
developing with RSpec.

I think it would be nice for developers with non-english clients to open
the possibility for writing RSpec Stories in other languages.

Currently the story template words ("Story", "Scenario", "Given", etc.)
are hard coded, but it shouldn't be difficult to manage them as a
configurable hash.

I don't have a good knowledge of the code behind RSpec but I've managed
to modify 1.1.3 (r3281) code to achieve that goal. Now I can run my
brand-new spanish stories!

I send the differences with the 3281 revision attached. Before I run the
stories I set the value of the words:

   Spec::Runner.configure do |config|
     config.with_story_template_words({
       :story          => "Relato",
       :scenario       => 'Escenario',
       :given          => 'Dado',
       :given_scenario => 'DadoElEscenario',
       :when           => 'Cuando',
       :then           => 'Entonces',
       :and            => 'Y'
     })
   end

I'm sure it's not the best way to implement the functionality, but I
just want to let you know the desire and a (very) simple way to get it
(partially, I only use PlainText output) done.

Thanks for listening ;)

Cheers!
Nando

-- 
Fernando García Samblas
fernando.garcia at the-cocktail.com

The Cocktail
C/ Salamanca 17
28020 Madrid
+34 91 567 06 05

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: rspec_r3281_with_story_template_words.diff
Url: http://rubyforge.org/pipermail/rspec-devel/attachments/20080201/d4323703/attachment.pl 


More information about the rspec-devel mailing list