Hacker News new | ask | show | jobs
by algorithmmonkey 4651 days ago
Disclaimer: I'm not for or against the use of cucumber.

The second claim against cucumber / gherkin is not it's fault, it's the toolset's fault. Using grep to find your step definition is not very effective.

If you use a tool like Rubymine, you can jump directly to the applicable step definition through one key combination.

2 comments

You should read http://catb.org/esr/writings/unix-koans/gui-programmer.html

In practice, you'll find grep is in the toolkit of far more Ruby programmers than the IDE Rubymine. And with good reason!

The real problem is step definitions with regex in them. You don't need to do this. Steak was written to avoid this problem: https://github.com/cavalle/steak

But the underlying issue described in this post is still valid - Cucumber is an unnecessary layer because it adds no value that you don't get with Capybara and your favourite testing framework.

Thank you for the heads up about ruby devs liking *nix tools and not ide's.

The fact of the matter is grep is a poor tool to try to find your step definitions. There are tools out there that are much better for such things, vim with http://www.vim.org/scripts/script.php?script_id=2973, or an ide or <your favorite tool>.

You could make the claim that any abstraction is unnecessary if you see no value in it. It doesn't mean others will not find value in it.

Personally, I find it quite easy to understand and convey to non-devs the stories told through gherkin. That is part of the value prop for me.

If no one is reading them but the devs, I'd rather use something other than gherkin.

Cucumber also prints the step source file and line number with a command-line argument.