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 tests warning #1173

Merged
merged 3 commits into from
May 12, 2018
Merged

Fix tests warning #1173

merged 3 commits into from
May 12, 2018

Conversation

vbrazo
Copy link
Member

@vbrazo vbrazo commented Mar 27, 2018

This PR was created because of this issue #1171.

The goal is to clean up the warnings that appear when we run bundle && bundle exec rake.

  • Removed unused test variables.

screen shot 2018-03-26 at 11 28 50 pm

  • We had a duplicated test class which was resulting this warning:
/Users/vitoroliveira/faker/test/test_zh_locale.rb:8: warning: method redefined; discarding old teardown
/Users/vitoroliveira/faker/test/test_zh_cn_locale.rb:8: warning: previous definition of teardown was here
  • ElderSchool had a duplicated method (two first_name methods). It should be first_name and last_name
  • Added tests for ElderSchool first_name and last_name methods

@vbrazo vbrazo changed the title Add remove unused test variables Remove unused test variables Mar 27, 2018
@vbrazo vbrazo changed the title Remove unused test variables Fix tests warning Mar 28, 2018
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/test_helper.rb')

class TestZhCnLocale < Test::Unit::TestCase
class TestZhLocale < Test::Unit::TestCase
Copy link
Member Author

@vbrazo vbrazo Mar 28, 2018

Choose a reason for hiding this comment

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

Take a look at the name of this file. Definitely copy and 🍝

@@ -29,10 +29,9 @@ def first_name
fetch('elder_scrolls.first_name')
end

def first_name
def last_name
Copy link
Member Author

Choose a reason for hiding this comment

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

Fixing duplicated methods. Copy and 🍝 and adding specs for the new methods 👍

@@ -57,8 +57,7 @@ def test_omniauth_google_with_name
auth = @tester.google(name: custom_name)
info = auth[:info]
extra_raw_info = auth[:extra][:raw_info]
id_info = auth[:id_info]


Copy link
Member Author

Choose a reason for hiding this comment

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

These variables are not being used. Why are we still declaring them? Copy and 🍝 again?

@vbrazo vbrazo merged commit 4063853 into faker-ruby:master May 12, 2018
@vbrazo vbrazo deleted the chores/remove-unused-test-variables branch May 12, 2018 16:37
davidmorton0 pushed a commit to davidmorton0/faker that referenced this pull request Jul 12, 2021
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.

1 participant