spec/support/database.rb in pg_search-2.1.1 vs spec/support/database.rb in pg_search-2.1.2
- old
+ new
@@ -40,11 +40,11 @@
def install_extension(name)
connection = ActiveRecord::Base.connection
extension = connection.execute "SELECT * FROM pg_catalog.pg_extension WHERE extname = '#{name}';"
return unless extension.none?
connection.execute "CREATE EXTENSION #{name};"
-rescue => exception # rubocop:disable Lint/RescueWithoutErrorClass
+rescue StandardError => exception
at_exit do
puts "-" * 80
puts "Please install the #{name} extension"
puts "-" * 80
end
@@ -52,10 +52,10 @@
end
def install_extension_if_missing(name, query, expected_result)
result = ActiveRecord::Base.connection.select_value(query)
raise "Unexpected output for #{query}: #{result.inspect}" unless result.downcase == expected_result.downcase
-rescue # rubocop:disable Lint/RescueWithoutErrorClass
+rescue StandardError
install_extension(name)
end
install_extension_if_missing("pg_trgm", "SELECT 'abcdef' % 'cdef'", "t")
install_extension_if_missing("unaccent", "SELECT unaccent('foo')", "foo")