← Back to Upcase

TDD Workshop: Twitter gem no longer uses .results


(Peter Tuan) #1

Hi all, I’m going through the TDD workshop and noticed that in the Searcher class,

@results = searcher.search(search_term).results

no longer works. I looked in the Twitter gem documentation and it seems that I would have to do .take(15) to return 15 results.

This works fine until I get to FakeTwitter.search returning an OpenStruct.new(take: @results[term]) and not running because of an ArgumentError: wrong number of arguments (1 for 0).

Is there a good way to make this work? It doesn’t seem like an OpenStruct as a fake can have a take method that takes in an attribute.

Thanks!


(Peter Tuan) #2

Just noticed there’s a specific TDD Workshop section and posted it there. Is there any way this post can be deleted?