summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/net/client_test.rb4
-rw-r--r--test/net/hippie_test.rb13
2 files changed, 15 insertions, 2 deletions
diff --git a/test/net/client_test.rb b/test/net/client_test.rb
index fa15c4f..9ef6b03 100644
--- a/test/net/client_test.rb
+++ b/test/net/client_test.rb
@@ -306,8 +306,8 @@ class ClientTest < Minitest::Test
end
def test_open_timeout_setting
- assert_nil subject.open_timeout
- @subject.open_timeout = 10
assert_equal subject.open_timeout, 10
+ @subject.open_timeout = 5
+ assert_equal subject.open_timeout, 5
end
end
diff --git a/test/net/hippie_test.rb b/test/net/hippie_test.rb
index c5a0312..9da4abe 100644
--- a/test/net/hippie_test.rb
+++ b/test/net/hippie_test.rb
@@ -21,4 +21,17 @@ class HippieTest < Minitest::Test
Net::Hippie.verify_mode = OpenSSL::SSL::VERIFY_NONE
assert Net::Hippie.verify_mode == OpenSSL::SSL::VERIFY_NONE
end
+
+ def test_get_with_retry
+ uri = URI.parse('https://www.example.org/api/scim/v2/schemas')
+ WebMock.stub_request(:get, uri.to_s)
+ .to_timeout.then
+ .to_timeout.then
+ .to_timeout.then
+ .to_return(status: 200, body: { 'success' => 'true' }.to_json)
+ response = Net::Hippie.get(uri)
+ refute_nil response
+ assert_equal Net::HTTPOK, response.class
+ assert_equal JSON.parse(response.body)['success'], 'true'
+ end
end