Skip to content
Open
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
13 changes: 0 additions & 13 deletions lib/faker/default/company.rb
Original file line number Diff line number Diff line change
Expand Up @@ -660,19 +660,6 @@ def spanish_b_algorithm(value)

result.to_s[0].to_i + result.to_s[1].to_i
end

def calculate_gst_checksum(state_code, taxpayer_number, registration_number)
gst_base = "#{state_code}#{taxpayer_number}#{registration_number}"
chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'.chars
values = gst_base.upcase.chars
sum = values.map.with_index do |char, index|
product = chars.index(char) * (index.odd? ? 2 : 1)
(product / chars.length).floor + (product % chars.length)
end.reduce(:+)

checksum = (chars.length - (sum % chars.length)) % chars.length
chars[checksum]
end
end
end
end
6 changes: 0 additions & 6 deletions lib/faker/default/types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,6 @@ def random_complex_type
rb_array
end
end

private

def titleize(word)
word.split(/(\W)/).map(&:capitalize).join
end
end
end
end
10 changes: 0 additions & 10 deletions test/faker/default/test_faker_types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
require_relative '../../test_helper'

class TestFakerTypes < Test::Unit::TestCase
module TestModule
end

def setup
@tester = Faker::Types
end
Expand Down Expand Up @@ -74,13 +71,6 @@ def test_array_has_the_right_array
assert_equal(1, @tester.rb_array.length)
end

def test_titleize
val = 'foobar'
expected = 'Foobar'

assert_equal @tester.send(:titleize, val), expected
end

def test_resolve
array = [1, 2, 3]
range = 1..10
Expand Down