2014-07-06 3 views

답변

0

아루바가 해결책을 제시합니다. 우선, 내 실수는 if __FILE__ == $0을 확인하지 않고 앱의 루트 클래스의 새 인스턴스를 만드는 것이 었습니다.

그리고 마침내는 다음과 같습니다

dashboard.feature:

Feature: Manage app with dashboard 
As an app user 
In order to control application 
I want to have a dashboard 

Scenario: View dashboard 
    When I run `../../lib/reporter.rb` interactively 
    Then I should see following choices 
    | 1 | Choice 1 | 
    | 2 | Choice 2 | 
    | 3 | Choice 3 | 

steps.rb:

Then(/^I should see following choices$/) do |table| 
    menu = '' 
    table.rows_hash.each do |key, value| 
    menu << "#{key}. #{value}\n" 
    end 
    Timeout::timeout(exit_timeout) do 
    loop do 
     break if assert_partial_output_interactive(menu) 
     sleep 0.1 
    end 
    end 
end