File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6363 end
6464 end
6565
66+ it "adds User-Agent header using default" do
67+ WebMock . stub_request ( :get , uri ) . with do |request |
68+ expect ( request . headers [ 'User-Agent' ] ) . to eq "Ruby RDF.rb/#{ RDF ::VERSION } "
69+ end . to_return ( body : "foo" )
70+ RDF ::Util ::File . open_file ( uri ) do |f |
71+ opened . opened
72+ end
73+ end
74+
75+ it "used provided User-Agent header" do
76+ WebMock . stub_request ( :get , uri ) . with do |request |
77+ expect ( request . headers [ "User-Agent" ] ) . to eq "Foo"
78+ end . to_return ( body : "foo" )
79+ RDF ::Util ::File . open_file ( uri , headers : { "User-Agent" => "Foo" } ) do |f |
80+ opened . opened
81+ end
82+ end
83+
6684 it "sets content_type and encoding to utf-8 if absent" do
6785 WebMock . stub_request ( :get , uri ) . to_return ( body : "foo" , headers : { "Content-Type" => "text/turtle" } )
6886 RDF ::Util ::File . open_file ( uri ) do |f |
You can’t perform that action at this time.
0 commit comments