Make client's internal methods private
This commit is contained in:
parent
3f6f79c111
commit
cee7f7e174
@ -26,6 +26,8 @@ module Manifique
|
|||||||
@metadata
|
@metadata
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
def fetch_website
|
def fetch_website
|
||||||
res = do_get_request @url
|
res = do_get_request @url
|
||||||
@html = Nokogiri::HTML(res.body)
|
@html = Nokogiri::HTML(res.body)
|
||||||
@ -46,8 +48,6 @@ module Manifique
|
|||||||
JSON.parse(res.body)
|
JSON.parse(res.body)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def parse_metadata_from_html
|
def parse_metadata_from_html
|
||||||
parse_title_from_html
|
parse_title_from_html
|
||||||
parse_meta_elements_from_html
|
parse_meta_elements_from_html
|
||||||
|
@ -60,7 +60,7 @@ RSpec.describe Manifique::WebClient do
|
|||||||
"Content-Type": "text/html; charset=utf-8"
|
"Content-Type": "text/html; charset=utf-8"
|
||||||
})
|
})
|
||||||
|
|
||||||
web_client.fetch_website
|
web_client.send(:fetch_website)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "instantiates an HTML parser object" do
|
it "instantiates an HTML parser object" do
|
||||||
@ -86,11 +86,11 @@ RSpec.describe Manifique::WebClient do
|
|||||||
"Content-Type": "application/json; charset=utf-8"
|
"Content-Type": "application/json; charset=utf-8"
|
||||||
})
|
})
|
||||||
|
|
||||||
web_client.fetch_website
|
web_client.send(:fetch_website)
|
||||||
end
|
end
|
||||||
|
|
||||||
subject do
|
subject do
|
||||||
web_client.fetch_web_manifest
|
web_client.send(:fetch_web_manifest)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "returns the fetched manifest as a hash" do
|
it "returns the fetched manifest as a hash" do
|
||||||
@ -107,11 +107,11 @@ RSpec.describe Manifique::WebClient do
|
|||||||
"Content-Type": "text/html; charset=utf-8"
|
"Content-Type": "text/html; charset=utf-8"
|
||||||
})
|
})
|
||||||
|
|
||||||
web_client.fetch_website
|
web_client.send(:fetch_website)
|
||||||
end
|
end
|
||||||
|
|
||||||
subject do
|
subject do
|
||||||
web_client.fetch_web_manifest
|
web_client.send(:fetch_web_manifest)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "returns false" do
|
it "returns false" do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user