Adds more specific error exception checks to tests

This commit is contained in:
Karl Southern
2016-05-17 16:31:35 +01:00
parent d362e791e5
commit baaeba3c07
2 changed files with 3 additions and 5 deletions

View File

@@ -15,7 +15,7 @@ RSpec.shared_context 'when initializing' do
it 'shouldn\'t register with a missing jar file' do
jdbc_settings['driver_jar_path'] = nil
plugin = LogStash::Plugin.lookup('output', 'jdbc').new(jdbc_settings)
expect { plugin.register }.to raise_error
expect { plugin.register }.to raise_error(LogStash::ConfigurationError)
end
end
@@ -64,8 +64,6 @@ RSpec.shared_context 'when outputting messages' do
it 'should save a event' do
expect { plugin.multi_receive([event]) }.to_not raise_error
sleep 5
# Verify the number of items in the output table
c = plugin.instance_variable_get(:@pool).getConnection
stmt = c.prepareStatement("select count(*) as total from #{jdbc_test_table} where message = ?")