Fre*_*III 5 ruby tdd bdd cucumber
我有一个功能"从外部网站导入文章".在我的第一个场景中,我测试从外部网站导入链接列表.
Feature: Importing articles from external website
Scenario: Searching articles on example.com and return the links
Given there is an Importer
And its URL is "http://example.com"
When we search for "demo"
Then the Importer should return 25 links
And one of the links should be "http://example.com/demo.html"
Run Code Online (Sandbox Code Playgroud)
在我的步骤中,我有一个@result数组中的25个链接.
在我的第二个场景中,我想采取其中一个链接并测试我正确解析文章的事实.
现在显然我不想每次都去外部网站,特别是现在第一个场景通过了.
我如何继续这里,以便我可以继续测试而不需要为第一个场景发出HTTP请求?或者我应该运行一次并@result在其他场景中保持阵列,以便我可以继续使用实际的结果集?
| 归档时间: |
|
| 查看次数: |
8235 次 |
| 最近记录: |