NoMethodError: undefined method `describe_to' for nil:NilClass

327 views
Skip to first unread message

Richard Donovan

unread,
Oct 24, 2017, 4:35:28 AM10/24/17
to Cucumber and Cheese
Hi All,

Running the first (empty) feature from 'Cucumber and Cheese', pages 44 and 45, I'm getting the following error - NoMethodError: undefined method `describe_to' for nil:NilClass.

I have set up the project framework exactly as described. See attached image.
My feature file is thus:

Feature: Making Cheese

As a cheese maker
I want to make cheese
So I can share my cheesiness

Scenario: Using the cheese machine
Given I have no cheese
When I press the make cheese button
Then I should have 1 piece of cheese

When I run the file I get this

C:\Ruby23-x64\bin\ruby.exe -EUTF-8 -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) C:\Ruby23-x64\bin/cucumber C:/Users/richard.donovan/Desktop/automation_files/automation_projects/automation_project_cheese/test_puppies/features/making_cheese.feature --format Teamcity::Cucumber::Formatter --expand --name "^Using the cheese machine$" --color -r features
Testing started at 09:24 ...
WARNING: The formatter Teamcity::Cucumber::Formatter is using the deprecated formatter API which will be removed in v4.0 of Cucumber.


NoMethodError: undefined method `describe_to' for nil:NilClass
C:/Program Files/JetBrains/RubyMine 2017.2/rb/testing/patch/bdd/teamcity/cucumber/common.rb:631:in `create_snippet_text'
C:/Program Files/JetBrains/RubyMine 2017.2/rb/testing/patch/bdd/teamcity/cucumber/common.rb:619:in `print_undef_step_snippet'
C:/Program Files/JetBrains/RubyMine 2017.2/rb/testing/patch/bdd/teamcity/cucumber/common.rb:479:in `log_status_and_test_finished'
C:/Program Files/JetBrains/RubyMine 2017.2/rb/testing/patch/bdd/teamcity/cucumber/common.rb:402:in `tc_before_step_result'
C:/Program Files/JetBrains/RubyMine 2017.2/rb/testing/patch/bdd/teamcity/cucumber/formatter_03103.rb:131:in `before_step_result'
-e:1:in `load'
-e:1:in `<main>'
1 scenario (1 failed)
2 steps (1 failed, 1 undefined)
0m6.314s

Process finished with exit code 1

I should get the following output. Any ideas on how to fix?

Feature: Making Cheese
As a cheese maker
I want to make cheese
So I can share my cheesiness

Scenario: Using the cheese machine
Given I have no cheese
When I press the make cheese button
Then I should have 1 piece of cheese

1 scenario (1 undefined)
3 steps (3 undefined)
13 0m0.232s

You can implement step definitions for undefined steps with these snippets:

Given /^I have no cheese$/ do
pending # express the regexp above with the code you wish …
end

When /^I press the make cheese button$/ do
pending # express the regexp above with the code you wish …
end

Then /^I should have (\d+) piece of cheese$/ do |arg1|
pending # express the regexp above with the code you wish …
end

Carlos GZ

unread,
Oct 24, 2017, 6:28:25 AM10/24/17
to Richard Donovan, Cucumber and Cheese
Hi Richard

I know what this problem is, it's to do with the RubyMine/Intellij run configuration. Go to Edit Configurations.. and then put the following in the Runner options field: -f pretty

Inline images 1

Or alternatively you can open a terminal/cmd prompt, change directory into the project directory and run your feature using: bundle exec cucumber.

Hope this helps

Carlos

Virus-free. www.avast.com

Sunday Times TechTrack100 & Deloitte Fast50 2013, 2014

Best Companies 2 Star Outstanding 2014, 2015

Ten10 Solutions Limited is a company registered in England and Wales. 

Registered number: 06326413. Registered address: Amelia House, Crescent Road, Worthing BN11 1QR. 

***** Email confidentiality notice *****

This message is private and confidential. If you have received this message in error, please notify us and remove it from your system.

Richard Donovan

unread,
Oct 24, 2017, 7:55:52 AM10/24/17
to Carlos GZ, Cucumber and Cheese

Hi,

 

Thanks for the help.

 

How do I get to the ‘Edit Configuration’ window? I’m using RubyMine.

 

Richard Donovan

Senior Consultant

 

Ten10 Logo

 

E

 richard...@ten10.com

W

 http://www.ten10.com

Ten10 is the rebranded name for The Test People - Centre4 Testing. The two companies merged in December 2015, creating the UK's leading software testing company.

Richard Donovan

unread,
Oct 24, 2017, 8:01:37 AM10/24/17
to Carlos GZ, Cucumber and Cheese

Never mind, got it. Thanks

 

Richard Donovan

Senior Consultant

 

Ten10 Logo

 

E

 richard...@ten10.com

W

 http://www.ten10.com

Ten10 is the rebranded name for The Test People - Centre4 Testing. The two companies merged in December 2015, creating the UK's leading software testing company.

 

From: Carlos GZ [mailto:cjc.gu...@gmail.com]

Sent: 24 October 2017 11:28
To: Richard Donovan <richard...@ten10.com>
Cc: Cucumber and Cheese <cucumber-...@googlegroups.com>

Reply all
Reply to author
Forward
0 new messages