Ho un'applicazione Sinatra e ho bisogno di testare la mia domanda.livello di stack troppo profondo (SystemStackError)
caratteristiche/supporto/env.rb:
require_relative "../../application"
require "capybara"
require "capybara/cucumber"
require "rspec"
World do
Capybara.app = Application
include Capybara::DSL
include RSpec::Matchers
end
caratteristiche/one.feature:
Feature: Test homepage
In order to make sure people can open my site
I want to check it opened
Scenario: Opening first page
Given I have opened homepage
Then I should see site header
prova è:
cucumber features\one.feature
Risultato:
Feature: Test homepage
In order to make sure people can open my site
I want to check it opened
Scenario: Opening first page # features\one.feature:5
Given I have opened homepage # features\one.feature:6
Then I should see site header # features\one.feature:7
1 scenario (1 undefined)
2 steps (2 undefined)
0m0.006s
You can implement step definitions for undefined steps with these snippets:
Given /^I have opened homepage$/ do
pending # express the regexp above with the code you wish you had
end
Then /^I should see site header$/ do
pending # express the regexp above with the code you wish you had
end
Beh, ho creato caratteristiche/step_definitions/agenda_steps.rb:
Given /^I have opened homepage$/ do
pending # express the regexp above with the code you wish you had
end
Then /^I should see site header$/ do
pending # express the regexp above with the code you wish you had
end
prova è:
cucumber features\one.feature
Risultato:
Feature: Test homepage
In order to make sure people can open my site
I want to check it opened
Scenario: Opening first page # features\one.feature:5
Given I have opened homepage # features/step_definitions/agenda_steps.rb:1
C:/Ruby193/bin/cucumber:19: stack level too deep (SystemStackError)
Perché e come posso aggiustarlo?
Aggiornato: il problema sparita se riscrivo la mia env.rb in questo modo:
require_relative "../../application"
require "capybara"
require "capybara/cucumber"
require "rspec"
Capybara.app = Application
#World do
# Capybara.app = Application
#
# include Capybara::DSL
# include RSpec::Matchers
#end
potete inserire il vostro Gemfile.lock anche o più così quello che le versioni di cetriolo, capibara e RSpec si utilizza – Dan
ho postato il mio Gemfile.lock qui: http://pastebin.com/8Ni5MSdj – demas
@Jacob, Rspec è per asserzioni mentre Capybara parla solo con il web Driver. Detto questo, hai sicuramente bisogno sia di Rspec che di Capibara (e probabilmente anche di selenio) –