Mam aplikację Sinatra i muszę przetestować moją aplikację.poziom stosu zbyt głęboki (SystemStackError)
funkcje/support/env.rb:
require_relative "../../application"
require "capybara"
require "capybara/cucumber"
require "rspec"
World do
Capybara.app = Application
include Capybara::DSL
include RSpec::Matchers
end
funkcje/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
testu to:
cucumber features\one.feature
Wynik:
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
Cóż, stworzyliśmy funkcje/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
testu to:
cucumber features\one.feature
Wynik:
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)
Dlaczego i jak czy mogę to naprawić?
Aktualizacja: problem zniknął gdybym przepisać mój env.rb tak:
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
Czy możesz umieścić swój Gemfile.lock również lub więcej, jakie wersje ogórek, kapibara i rspec używasz – Dan
Wysłałem mój Gemfile.lock tutaj: http://pastebin.com/8Ni5MSdj – demas
@Jacob, Rspec jest dla stwierdzeń, podczas gdy Capybara po prostu rozmawia ze sterownikiem sieciowym. Biorąc to pod uwagę, zdecydowanie potrzebujesz zarówno Rspec & Capybara (i prawdopodobnie także Selenium) –