Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
Watson1978 committed Nov 23, 2023
1 parent d963849 commit cc5a984
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/test_future.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit cc5a984

Please sign in to comment.