Skip to content

Commit

Permalink
Merge pull request #187 from marshall-lee/fix/spec-tempfile
Browse files Browse the repository at this point in the history
Close tempfile before passing it to libcurl
  • Loading branch information
Phil Toland authored Aug 1, 2022
2 parents 4bc6631 + 2176414 commit 2f1dd51
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 2f1dd51

Please sign in to comment.