Skip to content

Commit

Permalink
Close tempfile before passing it to libcurl
Browse files Browse the repository at this point in the history
Closes #184
  • Loading branch information
marshall-lee committed Aug 1, 2022
1 parent 4bc6631 commit 2176414
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion spec/session_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -450,12 +450,14 @@ def yaml_load(str)

it "should store cookies across multiple requests" do
tf = Tempfile.new('cookiejar')
tf.close
cookie_jar_path = tf.path

@session.handle_cookies(cookie_jar_path)
response = @session.get("/setcookie").body

cookie_jar_contents = tf.read
cookie_jar_contents = tf.open.read
tf.unlink
expect(cookie_jar_contents).not_to be_empty
expect(cookie_jar_contents).to include('Netscape HTTP Cookie File')
end
Expand Down

0 comments on commit 2176414

Please sign in to comment.