forked from ontoportal/ontologies_api_ruby_client
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtest_case.rb
More file actions
34 lines (29 loc) · 876 Bytes
/
test_case.rb
File metadata and controls
34 lines (29 loc) · 876 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# frozen_string_literal: true
require 'logger'
require 'active_support'
require 'active_support/logger'
require 'minitest/autorun'
require 'minitest/hooks/test'
require_relative '../lib/ontologies_api_client'
require_relative '../config/config'
Logger = ::Logger unless defined?(Logger)
module Rails
def self.cache
@cache ||= ActiveSupport::Cache::MemoryStore.new
end
end
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