• 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30

最新にしたらpaths.rbとBackgroundが追加されていたのでメモ。

###features/support/paths.rb
Cucumberを最新にしてfeatureをgenerateしようとしたらpaths.rbがないと怒られたので、script/generate cucumberでpaths.rbファイルを生成しました。

Scenarioで記述するページはここで定義:
rails>>
#features/support/paths.rb
module NavigationHelpers
def path_to(page_name)
case page_name
when /the homepage/
root_path
<<--

###Background
1feature内のScenarioに共通な前提条件を記述する。
Backgroundで書かれた条件は、各Scenario実行前、かつBefore Hookの後に実行されるようです。

The background is run before each of your scenarios but after any of your Before Hooks.
http://wiki.github.com/aslakhellesoy/cucumber/background

rails>>
Background:
Given a global administrator named “Greg”
And a blog named “Greg’s anti-tax rants”
And a customer named “Dr. Bill”
And a blog named “Expensive Therapy” owned by “Dr. Bill”
<<--

posted by satoko satoko on Fri 17 Apr 2009 at 04:04 with 0 comments