diff --git a/test/test_future.rb b/test/test_future.rb index 7ebf074..d9e292c 100644 --- a/test/test_future.rb +++ b/test/test_future.rb @@ -76,4 +76,25 @@ def test_on_failure assert_raises(Ilios::Cassandra::ExecutionError) { future.on_failure {} } end + + def test_complex_case + statement = Ilios::Cassandra.session.prepare('SELECT * FROM ilios.test;') + future = Ilios::Cassandra.session.execute_async(statement) + + count = 0 + + future.on_failure do + count += 1 + end + + sleep(2) + + future.on_success do + count += 1 + end + + future.await + + assert_equal(1, count) + end end