forked from fhir-crucible/fhir_client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
basic_test.rb
27 lines (24 loc) · 812 Bytes
/
basic_test.rb
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
require_relative '../test_helper'
class BasicTest < Test::Unit::TestCase
def client
@client ||= FHIR::Client.new("feed-test")
end
def test_client_initialization
assert !client.use_format_param, 'Using _format instead of [Accept] headers.'
end
def test_client_logs_without_response
stub = stub_request(:get, /feed-test/).to_timeout
# This used to provide a NoMethodError:
# undefined method `request' for nil:NilClass
# on the line which logs the request/response, because Response was nil
assert_raise RestClient::RequestTimeout do
client.read(FHIR::Patient, 123)
assert_requested stub
end
client.use_oauth2_auth = true
assert_raise RestClient::RequestTimeout do
client.read(FHIR::Patient, 123)
assert_requested stub
end
end
end