diff options
| author | mo <mo@mokhan.ca> | 2018-05-07 13:57:55 -0600 |
|---|---|---|
| committer | mo <mo@mokhan.ca> | 2018-05-07 13:57:55 -0600 |
| commit | 4e183a8977c9ce3392aba6031c3218b9e92623de (patch) | |
| tree | 4049a8244c4170f98c806205411a06450dc2aa7b /test | |
| parent | d8dbf716aa99349adbd825ffea2b1c66c2aa7540 (diff) | |
add test for get using block syntax.
Diffstat (limited to 'test')
| -rw-r--r-- | test/net/client_test.rb | 11 |
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 |
