Skip to main content

Posts

Showing posts from June, 2013

Testing with Cucumber, Sinatra and Capybara

Everything you need to know There are many elements you need to simultaneously learn to do effective testing of your code. Because some of these elements are very simple a lot of explanations just jump over what you need to know and give them up as obvious. Let’s start with a list of the things you need to learn: Gherkin (the language of Cucumber) ——> super easy Capybara (the DSL that controls the browser tests) Rspec (the DSL in which the actual pass/fail tests are written.) None of these are hard. But having to learn all at the same time can seem daunting. But it’s not! It’s easy peasy but takes time. :-/ It took me three days to get a handle on this. And I hope by reading this you’ll get a handle on it much much quicker. Let’s start with Cucumber first. Cucumber Five things you need to know about Cucumber: Cucumber tests are located on a features folder that have plain text files with a .feature extension and written in Gherkin . The .feature files contain t

"That's just the way things are." and other cultural traps.

My college buddy just cancelled hanging out with me because it was going to be after 8pm and he didn't want to go out that late because he was worried about crime. He didn't excuse himself for feeling this way, or explain why being worried about crime would be an issue, he just texted me: Ok. Puerto Rico. Crime. A reality. I'd rather reschedule. Sorry to be an old man 8( And we're the same age! (By the way, as a close friend I understand what he means. He's got a young daughter and would rather stay at home with her than leave her alone.) I've been encountering this over and over. "That's just the way things are here." Or the much worse: "It's like that everywhere. " (The Japanese got "shikata ga nai", "it's no use.")   I'm still not sure why people don't see the huge trap going around like that is. Let me make a parallel. This morning I was watching a TED video from Lisa Bu , who talks about