シナトラアプリの例を考えると
post '/1' do
sleep(1) until @2
0
end
post '/2' do
@2 = true
0
end
および RSpec テストの例
describe 'test' do
it 'does /1' do
post '/1'
expect(last_response.body) to eq?(0)
end
it 'does /2'
post '/2'
expect(last_response.body) to eq?(0)
end
end
it does /1
/2 が呼び出されるのを待って、最初のテスト ( ) がハングします。
テスト #2 を開始する前に、テスト #1 の結果が完了するのを待たないように RSpec に指示することは可能ですか? 別名、RSpec で非同期テストは可能ですか?