Skip to content

Commit

Permalink
Resolve warnings during tests (#722)
Browse files Browse the repository at this point in the history
  • Loading branch information
andy-j authored and stympy committed Dec 17, 2016
1 parent 3df3da1 commit a6ad001
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
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 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

0 comments on commit a6ad001

Please sign in to comment.