Adventures with Ruby

Cucumber 0.5 and my little commit

View Comments

The strangest thing happened to me this week. I was working on a little side project at work. It seemed like a nice time to try out some new gems (Bundler and Devise: love it! InheritedResources, not that much, Formtastic, very nice). I was experimenting with Cucumber and writing Dutch features too.

I had figured that the supplied dutch keywords in languages.yml were not very practical. It supplied “Gegeven” as a naive translation of “Given“. Although this is correctly translated, it is very unpractical to form Dutch sentences with it. The only to really start a sentence with “Gegeven” is to write “Gegeven het feit dat…” (“Given the fact that…“). It’s very strange to say “Gegeven dat ik een profiel heb” (“Given I have a profile“) in Dutch.

I decided to use the synonym “Stel” like in “Stel ik heb een profiel“. Not entirely correct either because it misses a comma after “Stel“, but much better, in my honest opinion. So I forked cucumber, changed languages.yml and used this as custom git repository in my Gemfile.

Apparently I was in the middle of a Release Candidate, so what I had committed on github. The Rails integration was extracted out in that version (like RSpec does) to the “cucumber-rails” gem. This gave about an evening of confusion, but I got it to work eventually.

Two days later, we had visitors at our company, from another Ruby company, talking about cooperation on future projects. I introduced myself and he was trying to remember if he’d seen anything on the interwebs by me. That seems to be common. When meeting people on conferences it’s always the same question: “Do I know any of your gems?”.

Anyway, he had actually read my name recently, namely in the commit log of cucumber. Without asking or sending a pull request, they had added my commit to the 0.5 release of cucumber. A pleasant surprise! Aslak Hellesøy, you’re a very observant GitHub user!

By the way, you can still use “Gegeven“, as it is just an alias.

I am constantly wrestling with the best way write cucumber features down. Does anyone have Dutch features? Do you write them down with your customers or are they for developers only? Can you share some of them? Here are some of mine:

Scenario: Inloggen
  Stel ik ben uitgelogd
  En ik heb een account voor "gebruiker@test.com" met het wachtwoord "geheim"
  En ik ben op de inlogpagina
  Als ik de volgende velden invul:
    | E-mailadres | gebruiker@test.com  |
    | Wachtwoord  | geheim              |
  En ik op "Inloggen" druk
  Dan zie ik de melding "Je bent ingelogd"

Scenario: Verkeerd wachtwoord
  Stel ik ben uitgelogd
  En ik heb een account voor "gebruiker@test.com" met het wachtwoord "geheim"
  En ik ben op de inlogpagina
  Als ik de volgende velden invul:
    | E-mailadres | gebruiker@test.com  |
    | Wachtwoord  | verkeerd            |
  En ik op "Inloggen" druk
  Dan zie ik de foutmelding "Ongeldig e-mailadres of wachtwoord"

The RSpec BookBy the way, don’t forget to order the RSpec and Friends book. It’ll be released this februari and is a really good read if you want to learn BDD, RSpec or Cucumber.

Written by Iain Hecker

December 18th, 2009 at 4:15 pm

Posted in iain.nl

  • http://twitter.com/aslak_hellesoy Aslak Hellesøy

    Hi there Iain,

    I care about Cucumber, and the best way to do that is to care about users and contributors. I check on the Github network view a couple of days a week to see if someone has committed anything interesting: http://github.com/aslakhellesoy/cucumber/network

    So when people contribute small changes (like yours) it’s a no-brainer really. Just merge it in. It costs so little, but means a lot. It doesn’t matter if a contribution is small or big. It’s the sum that counts. So far 190 people have contributed to Cucumber. Bigger contributions usually take more time to get in. I usually like to have a discussion on the mailing list or IRC before I accept a bigger change.

    Cheers,
    Aslak

  • http://twitter.com/aslak_hellesoy Aslak Hellesøy

    Hi there Iain,

    I care about Cucumber, and the best way to do that is to care about users and contributors. I check on the Github network view a couple of days a week to see if someone has committed anything interesting: http://github.com/aslakhellesoy/cucumber/network

    So when people contribute small changes (like yours) it’s a no-brainer really. Just merge it in. It costs so little, but means a lot. It doesn’t matter if a contribution is small or big. It’s the sum that counts. So far 190 people have contributed to Cucumber. Bigger contributions usually take more time to get in. I usually like to have a discussion on the mailing list or IRC before I accept a bigger change.

    Cheers,
    Aslak

  • http://twitter.com/aslak_hellesoy Aslak Hellesøy

    BTW – it was hard to figure out how to leave a comment in your blog. There is a preview button, but no submit button. The only way to leave a comment is to place focus in one of the input fields (not the text area) and hit the Enter key. you won’t get a lot of comments like that :-)

  • http://twitter.com/aslak_hellesoy Aslak Hellesøy

    BTW – it was hard to figure out how to leave a comment in your blog. There is a preview button, but no submit button. The only way to leave a comment is to place focus in one of the input fields (not the text area) and hit the Enter key. you won’t get a lot of comments like that :-)

  • http://iain.nl Iain Hecker

    @Aslak, “Fixed” that by changing themes :)

  • http://iain.nl Iain Hecker

    @Aslak, “Fixed” that by changing themes :)

blog comments powered by Disqus
Fork me on GitHub