format internet:

…please wait (48% completed)…

Archive for the ‘madridrb’ Category

Cucumber, Selenium, Webrat, and Windows

Posted by javier ramirez on April 27, 2009

I spent last Saturday hacking around with some really smart people in Madrid. It’s not widely known than in Spain there’s a thriving Ruby on Rails community -my guess would be a language thing- but if you take a look at some of the Rails patches, Hackfest winners or the official Rails documentation project, you would be surprised to see how many -and how good- contributions are coming from this side of the world.

Once in a while we like to get together and take code challenges, so we can learn from each other and eat pizza to match the stereotype ;)

Thing is I’m a Windows guy. I know I should be sorry, I know it’s for housewives (or househusbands for that matter), but that’s life. (disclaimer: I’m planning to switch to Ubuntu in the near future)

As you know, developing software in windows while entirely possible is a bit more difficult than in other systems, specially when it comes to compiling, forking and the like.

Last Saturday I was, as usual, the only windows at hand (the rest being a lot of Macs in different flavors and a lonely Ubuntu) and, as a part of the code challenge, I had to run some tests with Cucumber, Selenium and Webrat. Apart from libxml, that has been working flawlessly in my computer for months, no other binaries were involved, so you would think everything was working just fine.. well, think twice.

First problem was the test server couldn’t be started automatically. I didn’t investigate much about it (my guess being that a fork or a system call is being issued and Windows cannot cope with it) since it was easier just to start it manually before running the tests. Also it was faster, because it didn’t need to be started every time.

After this obstacle, when I was trying to run the tests, I was getting a cryptic Errno::EADDRNOTAVAIL message. At first I thought it was because of Selenium not being able to bind to the given port, but a quick test from the command line discarded that possibility.

I don’t know anything about webrat (yet) but as the song goes, with a little help from my friends I was able to locate the source of the problem. When connecting to remote control Selenium, Webrat is trying to bind to the address “” and that’s something Windows doesn’t like.

All I had to do was opening the file “selecium_rc_server.rb” at the gem source and replacing “” by “”.

I was told I can do this much more clearly at the Webrat config, but I tried it out and I still had the same problem. Taking a look at the Webrat code I would say the config param is not honoured system-wide, but truth is I was in a hurry and I didn’t researched it thoroughly. I had a challenge to solve after all ;)

Once I did this, all was hunky dory. Selenium started, the form fields were filled in, the tests were passing (or not) and the result was displayed on my not-ansi console. Bummer.

Believe me, cucumber is not half the fun without the colors in the output. Fortunately enough, google can tell you where to find lots of ansi-aware console replacements. Unfortunately enough console2, my favourite, is not one of those.

So, there, it took a bit of extra work but now you can also run this neat stack in your good-old windows box.

Posted in development, javier ramirez, madrid, madridrb, ruby, ruby on rails, ruby on rails | Tagged: , , , | 6 Comments »

madrid-rb el grupo de ruby (y ruby on rails) de madrid

Posted by javier ramirez on April 22, 2008

Después de unos meses de silencio por overflow de actividades extraescolares, voy a intentar retomar el blog… aunque veremos lo que dura porque dentro de un par de días empiezo a dar clases otra vez.

Aprovecho la ocasión para anunciar la creación de madrid-rb, el grupo de ruby de madrid. Queremos organizarnos un poco y retomar las quedadas que se hacían hace tiempo, pero dándoles un carácter mensual. En concreto el último jueves de cada mes.

La idea es vernos, hacer comunidad, buscar puntos de encuentro comunes, dar alguna charlita ligera, juntarnos para hackear un poco y quizás crear alguna gema o algún plugin… y usarlo como excusa para salir un jueves al mes :p

La primera cita es este mismo jueves, a las 19:30, en el Starbucks de la calle Génova 4 en madrid.

El grupo se está organizando a través de este grupo de google. Además también tenemos un grupo creado en working with rails.

Y, lo anunciaré en la quedada del jueves, pero lo voy dejando ya por aquí, me han aprobado un proyecto en rubyforge para que podamos dejar el código que vayamos haciendo. Como puedes subir tus páginas estáticas y rubyforge mola, llevo idea de proponerlo para subir la home del grupo ahí.

Si no quieres perderte ninguna cita, hay disponible un calendario al que te puedes suscribir.

searchwords: madridrb, madrid, quedada, rubyforge, google groups

Posted in conferences, development, internet, javier ramirez, madrid, madridrb, ruby, ruby on rails | Tagged: , , , | 1 Comment »