Panda - fix search results to not throw an error if movie not found#25
Open
jperezish wants to merge 6 commits intoRubyoffRails:masterfrom
Open
Panda - fix search results to not throw an error if movie not found#25jperezish wants to merge 6 commits intoRubyoffRails:masterfrom
jperezish wants to merge 6 commits intoRubyoffRails:masterfrom
Conversation
lib/api.rb
Outdated
Author
|
@jwo here's my Tiger level. |
spec/movie_clerk_spec.rb
Outdated
Member
There was a problem hiding this comment.
good stuff on $stdout.... usually, when you re-assign stdout, you want to only do it temporarily, so you can do your thing, check your thing, and reset your thing.
Member
There was a problem hiding this comment.
Maybe use this technique on http://thinkingdigitally.com/archive/capturing-output-from-puts-in-ruby/
require 'stringio'
module Kernel
def capture_stdout
out = StringIO.new
$stdout = out
yield
return out
ensure
$stdout = STDOUT
end
end
results = capture_stdout do
puts "hi!"
end
results.string
=> "hi!\n"Only real tricky part is the "\n".... if you hate that, you could change to
results = capture_stdout do
print "hi"
end
results.string
=> "hi"
Member
|
Code looks excellent, btw. great submission |
Author
|
@jwo added the Eagle level. |
spec/movie_clerk_spec.rb
Outdated
Member
There was a problem hiding this comment.
You might want to use the "is near" when dealing with stuff like this.
clerk.tast_measurement.should be_within(0.01).of(4.44)
Member
|
Most excellent job! |
…age to use local variable and map inject
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.