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

Fix exit() in hook_context and a deprecation warning #218

Merged
merged 2 commits into from
Sep 21, 2017

Conversation

ekohl
Copy link
Member

@ekohl ekohl commented Sep 18, 2017

I didn't know how to write a proper test for this so I'm submitting this as is now. Pointers on how to properly write them would be appreciated.

@@ -34,7 +34,7 @@ def exit(code, &block)
end

def translate_exit_code(code)
return code if code.is_a?(Fixnum)
return code if code.is_a?(Integer) || code.is_a?(Fixnum)
Copy link
Contributor

Choose a reason for hiding this comment

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

will there be cases, where Integer doesn't suffice?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good question. I'm not that familiar with Ruby so I figured this was safer but it's supposed to be a base class so is just Integer sufficient?

Copy link
Contributor

Choose a reason for hiding this comment

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

I would say yes.

@ares
Copy link
Member

ares commented Sep 21, 2017

Thanks @ekohl, works well. Integer is the right class IMHO. Merging.

@ares ares merged commit 3a170d2 into theforeman:master Sep 21, 2017
@ekohl ekohl deleted the exit-handler branch September 25, 2017 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants