Skip to content

Commit

Permalink
Fix tests warnings (faker-ruby#979)
Browse files Browse the repository at this point in the history
  • Loading branch information
gssbzn authored and stympy committed Jul 12, 2017
1 parent 1819867 commit fb3f70d
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 27 deletions.
26 changes: 13 additions & 13 deletions lib/faker/family_guy.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
module Faker
class FamilyGuy < Base
class << self
def character
fetch('family_guy.character')
end
class << self
def character
fetch('family_guy.character')
end

def location
fetch('family_guy.location')
end
def location
fetch('family_guy.location')
end

def quote
fetch('family_guy.quote')
end
end
end
end
def quote
fetch('family_guy.quote')
end
end
end
end
20 changes: 10 additions & 10 deletions test/test_faker_league_of_legends.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,26 @@ def setup
end

def test_champions
assert @tester.champion.match(/\w+/)
assert_match(/\w+/, @tester.champion)
end

def test_location
assert @tester.location.match(/\w+/)
assert_match(/\w+/, @tester.location)
end

def test_quotes
assert @tester.quote.match(/\w+/)
def test_quote
assert_match(/\w+/, @tester.quote)
end

def test_quotes
assert @tester.summoner_spell.match(/\w+/)
def test_summoner_spell
assert_match(/\w+/, @tester.summoner_spell)
end

def test_quotes
assert @tester.masteries.match(/\w+/)
def test_masteries
assert_match(/\w+/, @tester.masteries)
end

def test_quotes
assert @tester.rank.match(/\w+/)
def test_rank
assert_match(/\w+/, @tester.rank)
end
end
2 changes: 1 addition & 1 deletion test/test_faker_number.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def test_normal
n = 10000
values = n.times.map { @tester.normal(150.0, 100.0) }
mean = values.reduce(:+) / n.to_f
variance = values.inject(0) { |variance, value| variance + (value - mean) ** 2 } / (n - 1).to_f
variance = values.inject(0) { |var, value| var + (value - mean) ** 2 } / (n - 1).to_f
std_dev = Math.sqrt variance

assert_in_delta 150.0, mean, 5.0
Expand Down
2 changes: 1 addition & 1 deletion test/test_faker_street.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def test_street_address_supports_flexible_formats
end
end

def test_street_address_supports_flexible_formats
def test_community_supports_flexible_formats
I18n.with_locale(:shire) do
assert_match(/Pine Place/, @tester.community)
end
Expand Down
4 changes: 2 additions & 2 deletions test/test_ja_locale.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require File.expand_path(File.dirname(__FILE__) + '/test_helper.rb')

class TestCaCatLocale < Test::Unit::TestCase
class TestJaLocale < Test::Unit::TestCase
def setup
Faker::Config.locale = 'ca-CAT'
Faker::Config.locale = 'ja'
end

def teardown
Expand Down

0 comments on commit fb3f70d

Please sign in to comment.