FIX: An `opts` hash was not, in fact, optional :)

This commit is contained in:
Robin Ward 2020-04-20 14:16:34 -04:00
parent ea8b40a53b
commit 8f5314bf98
2 changed files with 6 additions and 1 deletions

View File

@ -4,8 +4,8 @@ class TopicRetriever
def initialize(embed_url, opts = nil)
@embed_url = embed_url
@author_username = opts[:author_username]
@opts = opts || {}
@author_username = @opts[:author_username]
end
def retrieve

View File

@ -8,6 +8,11 @@ describe TopicRetriever do
let(:author_username) { "eviltrout" }
let(:topic_retriever) { TopicRetriever.new(embed_url, author_username: author_username) }
it "can initialize without optional parameters" do
t = TopicRetriever.new(embed_url)
expect(t).to be_present
end
describe "#retrieve" do
context "when host is invalid" do
before do