summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo <mo@mokhan.ca>2018-05-07 13:57:55 -0600
committermo <mo@mokhan.ca>2018-05-07 13:57:55 -0600
commit4e183a8977c9ce3392aba6031c3218b9e92623de (patch)
tree4049a8244c4170f98c806205411a06450dc2aa7b
parentd8dbf716aa99349adbd825ffea2b1c66c2aa7540 (diff)
add test for get using block syntax.
-rw-r--r--test/net/client_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/net/client_test.rb b/test/net/client_test.rb
index b04e685..406eab0 100644
--- a/test/net/client_test.rb
+++ b/test/net/client_test.rb
@@ -18,4 +18,15 @@ class Net::Hippie::ClientTest < Minitest::Test
assert_equal(283, JSON.parse(response.body).count)
end
end
+
+ def test_get_with_block_syntax
+ VCR.use_cassette("get_breaches") do
+ uri = URI.parse('https://haveibeenpwned.com/api/breaches')
+ subject.get(uri) do |request, response|
+ @response = response
+ end
+ refute_nil @response
+ assert_equal(283, JSON.parse(@response.body).count)
+ end
+ end
end