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

Tests shouldn't produce warnings #2857

Closed
wants to merge 8 commits into from

Conversation

raybaxter
Copy link
Contributor

Silence warnings about

warning: instance variable @id not initialized
warning: instance variable @Body not initialized

@@ -5,6 +5,11 @@ class Post
extend ActiveModel::Naming
include ActiveModel::Conversion
attr_writer :id, :body
def initialize
super
@id = nil
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you sure that the super won't use @id and @body?

I would add the @id, @body = nil before the super call.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, thanks.

Swapping.

@raybaxter raybaxter closed this Sep 5, 2011
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

5 participants