File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22require 'webmock/rspec'
33
44RSpec . shared_examples 'an RDF::HttpAdapter' do
5- DOAP_FILE = File . expand_path ( "../../../../etc/doap.nt" , __FILE__ )
5+ let ( :doap_file ) { File . expand_path ( "../../../../etc/doap.nt" , __FILE__ ) }
66
77 before ( :each ) do
88 raise '`http_adapter` must be defined with `let(:http_adapter`' unless
2222
2323 it "returns an http URL" do
2424 WebMock . stub_request ( :get , uri ) .
25- to_return ( body : File . read ( DOAP_FILE ) ,
25+ to_return ( body : File . read ( doap_file ) ,
2626 status : 200 ,
2727 headers : { 'Content-Type' => RDF ::NTriples ::Format . content_type . first } )
2828 f = RDF ::Util ::File . open_file ( uri )
184184 context "proxy" do
185185 it "requests through proxy" do
186186 WebMock . stub_request ( :get , uri ) .
187- to_return ( body : File . read ( DOAP_FILE ) ,
187+ to_return ( body : File . read ( doap_file ) ,
188188 status : 200 ,
189189 headers : { 'Content-Type' => RDF ::NTriples ::Format . content_type . first } )
190190 RDF ::Util ::File . open_file ( uri , proxy : "http://proxy.example.com" ) do |f |
You can’t perform that action at this time.
0 commit comments