"eval" is deprecated. Use "rate" instead

Writing cucumber functions recently I get a warning

[DEPRECATION] "eval" is deprecated. Please use "evaluate" instead 

Everything works fine, but this warning bothers me. I am using Rails 3.1.0 and ruby 1.9.3p392 (2013-02-22 version 39386) [x86_64-linux] . My files:

item.feature:

 Background: logged in as an admin Given I am logged in as an administrator 

user_steps.rb

  Given /^I am logged in as an administrator$/ do steps %Q{ Given the following users exist: | email | password | role | | admin@test.com | admin_password | admin | | visitor@visitor.com | visitor_password | registered | And I am on the "home page" And I follow "Login" And I fill in "Email" with " admin@test.com " And I fill in "Password" with "admin_password" And I press "Sign in" Then I should see "admin" } end 

And as a result, I:

  Background: logged in as an admin # features/item.feature:6 [DEPRECATION] "eval" is deprecated. Please use "evaluate" instead [DEPRECATION] "eval" is deprecated. Please use "evaluate" instead [DEPRECATION] "eval" is deprecated. Please use "evaluate" instead [DEPRECATION] "eval" is deprecated. Please use "evaluate" instead 
+7
source share
1 answer

Get in the same problem. It won't break anything, it's just ugly.

This seems to be a code mismatch . Guernick deprecated eval in favor of evaluate , and cucumber calls the old method. Everything is ready there for the transfer request and a closed problem for this on github

The fastest and easiest solution until the Cucumber update is updated, most likely, just add this line to your Gemfile:

 gem 'gherkin', '<= 2.11.6' 

This will make the ham go back to the time before the eval is deprecated.

Edit:

It seems that the cucumber stone has been updated and no longer contains resignation warnings.

+8
source

All Articles