Skip to content

Commit f756743

Browse files
committed
Don't use DOAP_FILE constant in shared examples, use variable instead.
1 parent 5a872b5 commit f756743

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lib/rdf/spec/http_adapter.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
require 'webmock/rspec'
33

44
RSpec.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
@@ -22,7 +22,7 @@
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)
@@ -184,7 +184,7 @@
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|

0 commit comments

Comments
 (0)