-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
panda level #14
base: master
Are you sure you want to change the base?
panda level #14
Conversation
year: struct.year, | ||
score: struct.ratings["critics_score"] | ||
) | ||
rescue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here you are rescuing the entire search_by_title
method, where no matter what exception is raised, you're showing "no_movie_found". That's not REALLY the case though. For example, if the API is down or broken, you still want people to be able to find their "Caddyshack"
This looks good! I added a comment on having rescues that reach a little too far. Let me know if that makes sense or if we should go into further detail. |
I understand what you are saying. Would you mind taking a look at Thanks, On Mon, Mar 11, 2013 at 2:46 PM, Jesse Wolgamott
|
The 6th spec is in the spec/movie_spec.rb. If you ran it separately you'd get what you expect. $ rspec spec/api_spec.rb
.....
Finished in 0.0053 seconds
5 examples, 0 failures I'll leave a couple comments on the spec file too :) |
movie.title.should eq("Forrest Gump") | ||
end | ||
before do | ||
expect { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not add the expect here in the before block. The before block is adding this test to every example.
I do think having this in the before makes sense, because you want every time it executes get_url_as_json
it should return that fixture.
Api.stub(:get_url_as_json) { JSON.parse(File.read("spec/fixtures/forrest.json"))
I'm pretty sure that lib\api.rb & movie_json.rb are correct. I had a lot of trouble with spec\api_spec.rb. When I run the spec, it says "6 examples 0 failures", but there are only 5 "it"s. Will appreciate any comments/suggestions. Thanks.