Skip to content
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

Logger#close nilable error fix #3184

Merged
merged 1 commit into from
Aug 23, 2016
Merged

Logger#close nilable error fix #3184

merged 1 commit into from
Aug 23, 2016

Conversation

JacobUb
Copy link
Contributor

@JacobUb JacobUb commented Aug 21, 2016

And a spec that would have revealed the bug earlier.

@oprypin
Copy link
Member

oprypin commented Aug 21, 2016

Seems like the check fails because the automatic tool thinks the code should be formatted differently. Please run crystal tool format and amend the commit(s).

@@ -86,4 +86,11 @@ describe "Logger" do
logger.info { a = 1 }
a.should eq(0)
end

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty sure it's these two spaces alone on the line

@JacobUb
Copy link
Contributor Author

JacobUb commented Aug 21, 2016

Good catch @BlaXpirit , I ran the tool on my computer and obviously I didn't see any changes so I thought it was ok 😄

@oprypin
Copy link
Member

oprypin commented Aug 21, 2016

It would be best to not introduce a 3rd commit just with the fix. Maybe you meant to amend the commit but something went wrong.

rebase -i HEAD~2 with changing the last commit to fixup can help.

@JacobUb
Copy link
Contributor Author

JacobUb commented Aug 21, 2016

Yeah, every time I type git [something] god kills a kitten. But it should be ok now.

IO.pipe do |r, w|
Logger.new(w).close
w.closed?.should be_true
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe test logger too?

IO.pipe do |_, io|
  logger = Logger.new(io)
  logger.close
  logger.closed?.should be_true
  io.closed?.should be_true
end

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But Logger itself doesn't have a closed? method.

@ysbaddaden
Copy link
Contributor

Oops. My bad.

@ysbaddaden ysbaddaden merged commit 07964d0 into crystal-lang:master Aug 23, 2016
@JacobUb JacobUb deleted the patch-1 branch August 23, 2016 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants