FIX: An `opts` hash was not, in fact, optional :)
This commit is contained in:
parent
ea8b40a53b
commit
8f5314bf98
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue