Skip to content

Commit

Permalink
use digest to compare response body
Browse files Browse the repository at this point in the history
  • Loading branch information
taf2 committed Feb 15, 2025
1 parent acb3654 commit 8374f96
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions tests/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
$CURB_TESTING = true
require 'uri'
require 'stringio'
require 'digest/md5'

$TOPDIR = File.expand_path(File.join(File.dirname(__FILE__), '..'))
$EXTDIR = File.join($TOPDIR, 'ext')
Expand Down
5 changes: 2 additions & 3 deletions tests/tc_curl_easy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1058,11 +1058,10 @@ def test_post_streaming
easy.multipart_form_post = true
easy.http_post(pf)

assert_not_equal(0,easy.body_str.size)
assert_equal(easy.body_str.tr("\r", ''), File.read(readme))
assert_not_equal(0,easy.body.size)
assert_equal(Digest::MD5.hexdigest(easy.body), Digest::MD5.hexdigest(File.read(readme)))
end


def test_easy_close
easy = Curl::Easy.new
easy.close
Expand Down

0 comments on commit 8374f96

Please sign in to comment.