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

Resolve warnings during tests #722

Merged
merged 2 commits into from
Dec 17, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/faker/code.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,17 @@ def generate_imei

# Calculate the Luhn checksum of the values thus far
len_offset = (len + 1) % 2
(0..(len - 1)).each do |pos|
if (pos + len_offset) % 2 != 0
t = str[pos] * 2
(0..(len - 1)).each do |position|
if (position + len_offset) % 2 != 0
t = str[position] * 2

if t > 9
t -= 9
end

sum += t
else
sum += str[pos]
sum += str[position]
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/faker/company.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ def luhn_algorithm(number)
multiplications << digit.to_i * 2
else
multiplications << digit.to_i
end
end
end

sum = 0

Expand Down
2 changes: 1 addition & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require 'rubygems'
require 'timecop'
require 'yaml'
YAML::ENGINE.yamler = 'syck' if defined? YAML::ENGINE
YAML::ENGINE.yamler = 'psych' if defined? YAML::ENGINE
require File.expand_path(File.dirname(__FILE__) + '/../lib/faker')

# configure I18n
Expand Down