Skip to content

Commit

Permalink
Naming fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vbrazo committed Jun 11, 2018
1 parent a30b6f3 commit 4e2f1aa
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Contents
- [Faker::Nation](doc/nation.md)
- [Faker::NatoPhoneticAlphabet](doc/nato_phonetic_alphabet.md)
- [Faker::NewGirl](doc/new_girl.md)
- [Faker::NHS](doc/nhs.md)
- [Faker::NationalHealthService](doc/national_health_service.md)
- [Faker::Number](doc/number.md)
- [Faker::Omniauth](doc/omniauth.md)
- [Faker::OnePiece](doc/one_piece.md)
Expand Down
9 changes: 9 additions & 0 deletions doc/national_health_service.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Faker::NationalHealthService

It might be available in the next version

```ruby
Faker::NationalHealthService.british_number #=> "403 958 5577"

Faker::NationalHealthService.check_digit(400_012_114) #=> 6
```
9 changes: 0 additions & 9 deletions doc/nhs.md

This file was deleted.

4 changes: 2 additions & 2 deletions lib/faker/nhs.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Faker
class NHS < Base
class NationalHealthService < Base
class << self
def nhs_number
def british_number
base_number = rand(400_000_000...499_999_999)
"#{base_number}#{check_digit(base_number)}".to_s
.chars
Expand Down
15 changes: 15 additions & 0 deletions test/test_faker_national_health_service.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
require File.expand_path(File.dirname(__FILE__) + '/test_helper.rb')

class TestFakerNationalHealthService < Test::Unit::TestCase
def setup
@tester = Faker::NationalHealthService
end

def test_nhs_british_number
assert_match(/\A\d{3}\s\d{3}\s\d{4}\z/, @tester.british_number)
end

def test_nhs_check_digit
assert_equal 6, @tester.check_digit(400_012_114)
end
end
15 changes: 0 additions & 15 deletions test/test_faker_nhs.rb

This file was deleted.

0 comments on commit 4e2f1aa

Please sign in to comment.