2013-04-06 13 views
7

możliwości pisania ogórka od niedawna Dostaję ostrzeżenie"eval" jest przestarzałe. Proszę użyć „oceniać” zamiast

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

wszystko działa poprawnie, ale ostrzeżenie to mnie niepokoi. Używam Rails 3.1.0 i ruby ​​1.9.3p392 (2013-02-22 wersja 39386) [x86_64-linux]. Moje pliki są:

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  | 
    | [email protected]  | admin_password | admin  | 
    | [email protected] | visitor_password | registered | 
    And I am on the "home page" 
    And I follow "Login" 
    And I fill in "Email" with "[email protected]" 
    And I fill in "Password" with "admin_password" 
    And I press "Sign in" 
    Then I should see "admin" 
} 
end 

I w rezultacie mam:

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 
+0

Następnie przejść z eval do oceny w kodzie? – fredrik

+0

Nie widzę "eval" w moich plikach – Andrew

Odpowiedz

8

Przebiegł dokładnie ten sam problem. Nic nie pęka, jest po prostu brzydka.

Wygląda na niezgodność kodu. Gherkin wycofał eval na rzecz evaluate, a Cucumber wywołuje starą metodę. Tam wszystko gotowe było prośba przyciąganie i a closed issue for this on github

Najszybszym i najprostszym rozwiązaniem aż ogórek jest aktualizowana, prawdopodobnie wkrótce, jest po prostu dodać tę linię do Gemfile:

gem 'gherkin', '<= 2.11.6' 

To zmusi korniszon z powrotem do czas przed eval był przestarzały.

Edit:

Wydaje się, że klejnot ogórek został zaktualizowany i nie produkują już ostrzeżenia amortyzację.

+0

Masz absolutną rację. Właśnie zauważyłem, że klejnot korniszonu został zaktualizowany do wersji 2.11.7 i zaczął wyświetlać ostrzeżenie. – Andrew

Powiązane problemy