Skip to content

Commit

Permalink
Validate API key in before_all
Browse files Browse the repository at this point in the history
jvendetti committed Jan 10, 2024
1 parent 4dd08e0 commit 53f330a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/test_case.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
# frozen_string_literal: true

require 'minitest/autorun'
require 'minitest/hooks/test'
require_relative '../lib/ontologies_api_client'
require_relative '../config/config'

module LinkedData
module Client
class TestCase < Minitest::Test
include Minitest::Hooks

def before_all
super
params = { q: 'Conceptual Entity', ontologies: 'STY', require_exact_match: 'true', display_links: 'false' }
response = LinkedData::Client::HTTP.get('/search', params)
if response.respond_to?('status') && response.status.eql?(401)
abort('ABORTED! You must provide a valid API key.')
end
end
end
end
end

0 comments on commit 53f330a

Please sign in to comment.