small medium large xlarge

Generic-user-small
10 Sep 2011, 09:13
Nigel Soden (4 posts)

I’m following the instruction from page 8 to page 9. I’ve created the dir called ‘features’ as indicated in the document, then I create the file called adding.features, again as per instructions.

When I run cucumber again I get the message :

You don’t have a ‘features’ directory. Please create one to get started. See http://cukes.info/ for more information.

I’ve tried running it from the ‘features’ dir but with the same end result.

What am I doing wrong?

Thx

Generic-user-small
10 Sep 2011, 09:32
Nigel Soden (4 posts)

I’ve just figured it out. I think the line in the book on page that reads.

When you save this file and run cucumber, you should see a great deal more output than the last time:

$ cucumber

Feature: Adding

Scenario: Add two numbers Given the input “2+2” When the calculator is run Then the output should be “4” 1 scenario (1 undefined) 3 steps (3 undefined) 0m0.003s

Should be formatted as

When you save this file and run cucumber, you should see a great deal more output than the last time:

$ cucumber Feature: Adding

Scenario: Add two numbers Given the input “2+2” When the calculator is run Then the output should be “4” 1 scenario (1 undefined) 3 steps (3 undefined) 0m0.003s

Generic-user-small
10 Sep 2011, 09:36
Nigel Soden (4 posts)

oops

Line : $ cucumber Feature: Adding, should be

$ cucumber features/adding.features

Scenario: Add two numbers Given the input “2+2” When the calculator is run Then the output should be “4” 1 scenario (1 undefined) 3 steps (3 undefined) 0m0.003s

Aslak_devil_pragsmall
11 Sep 2011, 14:41
Aslak Hellesøy (17 posts)

I’m a little confused about what the problem is here. Can you point out one more time what’s wrong with the book text and/or cucumber?

Generic-user-small
13 Sep 2011, 17:50
Nigel Soden (4 posts)

Its the way the text is formatted.

In the book it’s preseanted as follows.

$ cucumber

So I typed in cucumber at the $ prompt, pressed enter and nothing happens. However when I typed in at the $ prompt the following ‘cucumber features/adding.features’, without the quotes, of course, and then pressed enter, I then got the desired result.

Please forgive me but I’m very new to this so I may have miss understood or not read it correctly. I hope this helps somewhat.

Avatar_pragsmall
21 Sep 2011, 09:40
Matt Wynne (92 posts)

Hi Nigel,

That’s very odd, you should definitely have seen something happen when you typed the @cucumber@ command on it’s own. Can you tell us what operating system, version of Ruby etc. you’re using please?

Itsme_pragsmall
02 Oct 2011, 05:41
Mark Davis (2 posts)

Hi Nigel, I noticed you’re referencing a feature file called “adding.features”, should it be “adding.feature” instead? I noticed with my implementation, the file suffix needed to be the singular “feature” (as specified in the book) otherwise cucumber would not find it (and presumably it is better to have only one feature per file, implied by that suffix).

It might also help to be sure you’re in the parent directory of the “features” dir when running cucumber.

Avatar_pragsmall
02 Oct 2011, 09:30
Matt Wynne (92 posts)

Well spotted Mark, that will be the cause of Nigel’s problem. Cucumber will look for files with the @.feature@ extension. If you use a different file extension, however similar, it will not know it needs to run them.

Generic-user-small
21 May 2012, 17:47
Yuval M (1 post)

You can always have the feature/ directory and a sample passing test created in a rails app with:

rails generate cucumber:install

You must be logged in to comment