0
I am using the version of Gem Aruba 0.13.0 and Cucumber 2.x. x
would like to know how to detect the following error using a Ruba step Definition. More specifically if Exit status was successful and is possible by the type of error that is occurring in the execution of the application:
#!/usr/bin/env ruby
$:.unshift File.join(File.dirname(__FILE__), "..","lib")
require 'game'
game = Game.new
game.start
while not game.ended?
game.next_step
end
The error occurs when executing the above class by the command line.
bin/forca:10:in
Basically what he’s telling me is that the ended method isn’t defined, and it really isn’t, but Cucumber doesn’t detect the error.<main>': undefined methodended?' for #<'Game:0x000000012fc7d0 @output=#<'IO:<'STDOUT>>> (NoMethodError)
the functionality is as follows by Cucumber:
Funcionalidade: Começar jogo
Para poder passar o tempo
Como jogador
Quero poder começar um novo jogo
Cenário: Começo de novo jogo um sucesso
Ao começar o jogo, é mostrada a mensagem inicial para o jogador.
Quando começo um novo jogo
E termino o jogo
Então o jogo termina com a seguinte mensagem na tela:
"""
Bem vindo ao jogo da forca!
"""
use the following step to predict the error:
Então /^o jogo termina com a seguinte mensagem na tela:$/ do |text|
steps %{
Then it should pass with:
"""
#{text}
"""
}
end
Thanks for the feedback and edited for better understanding.
Put your Feature and your ruby screen, probably when Voce is calling your method it is not being referenced.
– Wellington Avelino
Oops, sorry for the delay! From what I saw he can’t find his . ended? method in the Game class, could post the class?
– Wellington Avelino