fluent/fluentd — pull request #399 by itiut (2014-08-08 06:47:43+00:00)
Title: Assert emits after InputTestDriver#run finished

I think it is problematic to specify expected emits by `InputTestDriver#expect_emit` before `#run` and assert them during `#run`.

* First, it needs to call `sleep` explicitly in the argument block of `#run` so that input loop will emit test data. But depending on the amount of sleeping time it cannot be ensured that all the test data has been emited before assertion.
* Second, assertions are hidden into `#run` from test codes and assertions occur during `#run`. So when some test fails during `#run`, where the fail occurs is not clear.

I rewirte `InputTestDriver#run` so that test codes specify only expected emits length before `#run` and assert emits after `#run`.

#397 and this pull request are same in that it is intended that `InputTestDriver#run` sleeps only enough amount of time. But how to specify the length of expected emits and where assersions are occured are different. I think this is better because test codes will be clearer, so if you merge this, please ignore #397.