area_code_validator 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -5
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +3 -0
- data/Gemfile.lock +102 -70
- data/README.md +8 -2
- data/area_code_validator.gemspec +4 -2
- data/lib/area_code_validator/version.rb +1 -1
- data/lib/config/area_code_config.rb +11 -11
- data/test/{dummy/test/area_code_validator_test.rb → area_code_validator_test.rb} +7 -7
- data/test/configuration/database.yml +5 -0
- data/test/configuration/schema.rb +7 -0
- data/test/{dummy/app/models → models}/phone.rb +0 -0
- data/test/{dummy/test/models/phone_test.rb → phone_test.rb} +1 -1
- data/test/{dummy/test/test_helper.rb → test_helper.rb} +19 -11
- metadata +62 -109
- data/test/dummy/README.rdoc +0 -28
- data/test/dummy/Rakefile +0 -6
- data/test/dummy/app/assets/images/.keep +0 -0
- data/test/dummy/app/assets/javascripts/application.js +0 -13
- data/test/dummy/app/assets/stylesheets/application.css +0 -13
- data/test/dummy/app/controllers/application_controller.rb +0 -5
- data/test/dummy/app/controllers/concerns/.keep +0 -0
- data/test/dummy/app/helpers/application_helper.rb +0 -2
- data/test/dummy/app/mailers/.keep +0 -0
- data/test/dummy/app/models/.keep +0 -0
- data/test/dummy/app/models/concerns/.keep +0 -0
- data/test/dummy/app/views/layouts/application.html.erb +0 -14
- data/test/dummy/bin/bundle +0 -3
- data/test/dummy/bin/rails +0 -4
- data/test/dummy/bin/rake +0 -4
- data/test/dummy/config/application.rb +0 -23
- data/test/dummy/config/boot.rb +0 -5
- data/test/dummy/config/database.yml +0 -25
- data/test/dummy/config/environment.rb +0 -5
- data/test/dummy/config/environments/development.rb +0 -29
- data/test/dummy/config/environments/production.rb +0 -80
- data/test/dummy/config/environments/test.rb +0 -36
- data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/test/dummy/config/initializers/filter_parameter_logging.rb +0 -4
- data/test/dummy/config/initializers/inflections.rb +0 -16
- data/test/dummy/config/initializers/mime_types.rb +0 -5
- data/test/dummy/config/initializers/secret_token.rb +0 -12
- data/test/dummy/config/initializers/session_store.rb +0 -3
- data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/test/dummy/config/locales/en.yml +0 -23
- data/test/dummy/config/routes.rb +0 -56
- data/test/dummy/config.ru +0 -4
- data/test/dummy/db/migrate/20131025094043_create_phones.rb +0 -14
- data/test/dummy/db/schema.rb +0 -23
- data/test/dummy/lib/assets/.keep +0 -0
- data/test/dummy/log/.keep +0 -0
- data/test/dummy/public/404.html +0 -58
- data/test/dummy/public/422.html +0 -58
- data/test/dummy/public/500.html +0 -57
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/test/fixtures/phones.yml +0 -9
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 1b54007e087ec7cec4a31bf004ee41989c6f0d9c
         | 
| 4 | 
            +
              data.tar.gz: 0bf629cfd0fe65e49ff48c52e1d2250ff0b22d0d
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 99a087bc485289eae77cd641e3addddbe6c0c5cbf1a96b73f8baa02be863c5a9d34f422c6272079159543f0478ca19b01135ced82868c85cbb78fe9ff5837f77
         | 
| 7 | 
            +
              data.tar.gz: f913dbf184debd3eb037a2ebe0f26cc1250f11b311afb4b773d8e576bdc029e3f65e9fd99db05d552cb7148733488db63b890c2c8c207f6cca82a52d92951696
         | 
    
        data/.gitignore
    CHANGED
    
    
    
        data/.ruby-gemset
    ADDED
    
    | @@ -0,0 +1 @@ | |
| 1 | 
            +
            area-code-validator
         | 
    
        data/.ruby-version
    ADDED
    
    | @@ -0,0 +1 @@ | |
| 1 | 
            +
            ruby-2.2.3
         | 
    
        data/.travis.yml
    ADDED
    
    
    
        data/Gemfile.lock
    CHANGED
    
    | @@ -1,89 +1,116 @@ | |
| 1 1 | 
             
            PATH
         | 
| 2 2 | 
             
              remote: .
         | 
| 3 3 | 
             
              specs:
         | 
| 4 | 
            -
                area_code_validator (0.0. | 
| 4 | 
            +
                area_code_validator (0.0.5)
         | 
| 5 5 |  | 
| 6 6 | 
             
            GEM
         | 
| 7 7 | 
             
              remote: https://rubygems.org/
         | 
| 8 8 | 
             
              specs:
         | 
| 9 | 
            -
                actionmailer (4. | 
| 10 | 
            -
                  actionpack (= 4. | 
| 11 | 
            -
                   | 
| 12 | 
            -
             | 
| 13 | 
            -
                   | 
| 14 | 
            -
                   | 
| 15 | 
            -
             | 
| 16 | 
            -
                   | 
| 9 | 
            +
                actionmailer (4.2.5)
         | 
| 10 | 
            +
                  actionpack (= 4.2.5)
         | 
| 11 | 
            +
                  actionview (= 4.2.5)
         | 
| 12 | 
            +
                  activejob (= 4.2.5)
         | 
| 13 | 
            +
                  mail (~> 2.5, >= 2.5.4)
         | 
| 14 | 
            +
                  rails-dom-testing (~> 1.0, >= 1.0.5)
         | 
| 15 | 
            +
                actionpack (4.2.5)
         | 
| 16 | 
            +
                  actionview (= 4.2.5)
         | 
| 17 | 
            +
                  activesupport (= 4.2.5)
         | 
| 18 | 
            +
                  rack (~> 1.6)
         | 
| 17 19 | 
             
                  rack-test (~> 0.6.2)
         | 
| 18 | 
            -
             | 
| 19 | 
            -
                   | 
| 20 | 
            -
             | 
| 21 | 
            -
             | 
| 22 | 
            -
                   | 
| 23 | 
            -
                   | 
| 24 | 
            -
                   | 
| 25 | 
            -
                   | 
| 26 | 
            -
                 | 
| 27 | 
            -
             | 
| 28 | 
            -
                   | 
| 29 | 
            -
             | 
| 30 | 
            -
                   | 
| 31 | 
            -
                   | 
| 32 | 
            -
             | 
| 33 | 
            -
             | 
| 34 | 
            -
             | 
| 35 | 
            -
             | 
| 20 | 
            +
                  rails-dom-testing (~> 1.0, >= 1.0.5)
         | 
| 21 | 
            +
                  rails-html-sanitizer (~> 1.0, >= 1.0.2)
         | 
| 22 | 
            +
                actionview (4.2.5)
         | 
| 23 | 
            +
                  activesupport (= 4.2.5)
         | 
| 24 | 
            +
                  builder (~> 3.1)
         | 
| 25 | 
            +
                  erubis (~> 2.7.0)
         | 
| 26 | 
            +
                  rails-dom-testing (~> 1.0, >= 1.0.5)
         | 
| 27 | 
            +
                  rails-html-sanitizer (~> 1.0, >= 1.0.2)
         | 
| 28 | 
            +
                activejob (4.2.5)
         | 
| 29 | 
            +
                  activesupport (= 4.2.5)
         | 
| 30 | 
            +
                  globalid (>= 0.3.0)
         | 
| 31 | 
            +
                activemodel (4.2.5)
         | 
| 32 | 
            +
                  activesupport (= 4.2.5)
         | 
| 33 | 
            +
                  builder (~> 3.1)
         | 
| 34 | 
            +
                activerecord (4.2.5)
         | 
| 35 | 
            +
                  activemodel (= 4.2.5)
         | 
| 36 | 
            +
                  activesupport (= 4.2.5)
         | 
| 37 | 
            +
                  arel (~> 6.0)
         | 
| 38 | 
            +
                activesupport (4.2.5)
         | 
| 39 | 
            +
                  i18n (~> 0.7)
         | 
| 40 | 
            +
                  json (~> 1.7, >= 1.7.7)
         | 
| 41 | 
            +
                  minitest (~> 5.1)
         | 
| 42 | 
            +
                  thread_safe (~> 0.3, >= 0.3.4)
         | 
| 43 | 
            +
                  tzinfo (~> 1.1)
         | 
| 44 | 
            +
                ansi (1.5.0)
         | 
| 45 | 
            +
                arel (6.0.3)
         | 
| 46 | 
            +
                builder (3.2.2)
         | 
| 47 | 
            +
                concurrent-ruby (1.0.0)
         | 
| 36 48 | 
             
                erubis (2.7.0)
         | 
| 37 | 
            -
                 | 
| 38 | 
            -
             | 
| 39 | 
            -
                 | 
| 40 | 
            -
             | 
| 41 | 
            -
             | 
| 42 | 
            -
             | 
| 43 | 
            -
                 | 
| 44 | 
            -
             | 
| 45 | 
            -
                 | 
| 46 | 
            -
                 | 
| 47 | 
            -
                 | 
| 49 | 
            +
                globalid (0.3.6)
         | 
| 50 | 
            +
                  activesupport (>= 4.1.0)
         | 
| 51 | 
            +
                i18n (0.7.0)
         | 
| 52 | 
            +
                json (1.8.3)
         | 
| 53 | 
            +
                loofah (2.0.3)
         | 
| 54 | 
            +
                  nokogiri (>= 1.5.9)
         | 
| 55 | 
            +
                mail (2.6.3)
         | 
| 56 | 
            +
                  mime-types (>= 1.16, < 3)
         | 
| 57 | 
            +
                mime-types (2.99)
         | 
| 58 | 
            +
                mini_portile2 (2.0.0)
         | 
| 59 | 
            +
                minitest (5.8.3)
         | 
| 60 | 
            +
                minitest-reporters (1.1.7)
         | 
| 61 | 
            +
                  ansi
         | 
| 62 | 
            +
                  builder
         | 
| 63 | 
            +
                  minitest (>= 5.0)
         | 
| 64 | 
            +
                  ruby-progressbar
         | 
| 65 | 
            +
                nokogiri (1.6.7.1)
         | 
| 66 | 
            +
                  mini_portile2 (~> 2.0.0.rc2)
         | 
| 67 | 
            +
                rack (1.6.4)
         | 
| 68 | 
            +
                rack-test (0.6.3)
         | 
| 48 69 | 
             
                  rack (>= 1.0)
         | 
| 49 | 
            -
                rails (4. | 
| 50 | 
            -
                  actionmailer (= 4. | 
| 51 | 
            -
                  actionpack (= 4. | 
| 52 | 
            -
                   | 
| 53 | 
            -
                   | 
| 70 | 
            +
                rails (4.2.5)
         | 
| 71 | 
            +
                  actionmailer (= 4.2.5)
         | 
| 72 | 
            +
                  actionpack (= 4.2.5)
         | 
| 73 | 
            +
                  actionview (= 4.2.5)
         | 
| 74 | 
            +
                  activejob (= 4.2.5)
         | 
| 75 | 
            +
                  activemodel (= 4.2.5)
         | 
| 76 | 
            +
                  activerecord (= 4.2.5)
         | 
| 77 | 
            +
                  activesupport (= 4.2.5)
         | 
| 54 78 | 
             
                  bundler (>= 1.3.0, < 2.0)
         | 
| 55 | 
            -
                  railties (= 4. | 
| 56 | 
            -
                  sprockets-rails | 
| 57 | 
            -
                 | 
| 58 | 
            -
                   | 
| 59 | 
            -
             | 
| 79 | 
            +
                  railties (= 4.2.5)
         | 
| 80 | 
            +
                  sprockets-rails
         | 
| 81 | 
            +
                rails-deprecated_sanitizer (1.0.3)
         | 
| 82 | 
            +
                  activesupport (>= 4.2.0.alpha)
         | 
| 83 | 
            +
                rails-dom-testing (1.0.7)
         | 
| 84 | 
            +
                  activesupport (>= 4.2.0.beta, < 5.0)
         | 
| 85 | 
            +
                  nokogiri (~> 1.6.0)
         | 
| 86 | 
            +
                  rails-deprecated_sanitizer (>= 1.0.1)
         | 
| 87 | 
            +
                rails-html-sanitizer (1.0.2)
         | 
| 88 | 
            +
                  loofah (~> 2.0)
         | 
| 89 | 
            +
                railties (4.2.5)
         | 
| 90 | 
            +
                  actionpack (= 4.2.5)
         | 
| 91 | 
            +
                  activesupport (= 4.2.5)
         | 
| 60 92 | 
             
                  rake (>= 0.8.7)
         | 
| 61 93 | 
             
                  thor (>= 0.18.1, < 2.0)
         | 
| 62 | 
            -
                rake (10. | 
| 94 | 
            +
                rake (10.4.2)
         | 
| 95 | 
            +
                ruby-progressbar (1.7.5)
         | 
| 63 96 | 
             
                shoulda (3.5.0)
         | 
| 64 97 | 
             
                  shoulda-context (~> 1.0, >= 1.0.1)
         | 
| 65 98 | 
             
                  shoulda-matchers (>= 1.4.1, < 3.0)
         | 
| 66 | 
            -
                shoulda-context (1.1 | 
| 67 | 
            -
                shoulda-matchers (2. | 
| 99 | 
            +
                shoulda-context (1.2.1)
         | 
| 100 | 
            +
                shoulda-matchers (2.8.0)
         | 
| 68 101 | 
             
                  activesupport (>= 3.0.0)
         | 
| 69 | 
            -
                sprockets ( | 
| 70 | 
            -
                   | 
| 71 | 
            -
                   | 
| 72 | 
            -
             | 
| 73 | 
            -
                   | 
| 74 | 
            -
             | 
| 75 | 
            -
                   | 
| 76 | 
            -
             | 
| 77 | 
            -
             | 
| 78 | 
            -
                 | 
| 79 | 
            -
                 | 
| 80 | 
            -
             | 
| 81 | 
            -
                  atomic
         | 
| 82 | 
            -
                tilt (1.4.1)
         | 
| 83 | 
            -
                treetop (1.4.15)
         | 
| 84 | 
            -
                  polyglot
         | 
| 85 | 
            -
                  polyglot (>= 0.3.1)
         | 
| 86 | 
            -
                tzinfo (0.3.38)
         | 
| 102 | 
            +
                sprockets (3.5.2)
         | 
| 103 | 
            +
                  concurrent-ruby (~> 1.0)
         | 
| 104 | 
            +
                  rack (> 1, < 3)
         | 
| 105 | 
            +
                sprockets-rails (3.0.0)
         | 
| 106 | 
            +
                  actionpack (>= 4.0)
         | 
| 107 | 
            +
                  activesupport (>= 4.0)
         | 
| 108 | 
            +
                  sprockets (>= 3.0.0)
         | 
| 109 | 
            +
                sqlite3 (1.3.11)
         | 
| 110 | 
            +
                thor (0.19.1)
         | 
| 111 | 
            +
                thread_safe (0.3.5)
         | 
| 112 | 
            +
                tzinfo (1.2.2)
         | 
| 113 | 
            +
                  thread_safe (~> 0.1)
         | 
| 87 114 |  | 
| 88 115 | 
             
            PLATFORMS
         | 
| 89 116 | 
             
              ruby
         | 
| @@ -91,7 +118,12 @@ PLATFORMS | |
| 91 118 | 
             
            DEPENDENCIES
         | 
| 92 119 | 
             
              area_code_validator!
         | 
| 93 120 | 
             
              bundler (~> 1.3)
         | 
| 94 | 
            -
               | 
| 121 | 
            +
              minitest
         | 
| 122 | 
            +
              minitest-reporters
         | 
| 123 | 
            +
              rails (~> 4.2.0)
         | 
| 95 124 | 
             
              rake
         | 
| 96 125 | 
             
              shoulda
         | 
| 97 126 | 
             
              sqlite3
         | 
| 127 | 
            +
             | 
| 128 | 
            +
            BUNDLED WITH
         | 
| 129 | 
            +
               1.11.2
         | 
    
        data/README.md
    CHANGED
    
    | @@ -1,3 +1,5 @@ | |
| 1 | 
            +
            [](https://travis-ci.org/amedeiros/area_code_validator)
         | 
| 2 | 
            +
             | 
| 1 3 | 
             
            # Area Code Validator
         | 
| 2 4 |  | 
| 3 5 | 
             
            Area Code Validator is a small gem that validates a phone numbers area code to a state.
         | 
| @@ -49,6 +51,10 @@ validates :work_phone, :florida_state,  area_code_invalid: true | |
| 49 51 | 
             
            4. Push to the branch (`git push origin my-new-feature`)
         | 
| 50 52 | 
             
            5. Create new Pull Request
         | 
| 51 53 |  | 
| 52 | 
            -
            ##  | 
| 54 | 
            +
            ## Author
         | 
| 55 | 
            +
             | 
| 56 | 
            +
            Andrew Medeiros, andrew@amedeiros.com, @_AndrewMedeiros
         | 
| 57 | 
            +
             | 
| 58 | 
            +
            ## Contributors
         | 
| 53 59 |  | 
| 54 | 
            -
             | 
| 60 | 
            +
            [jtwhittington](https://github.com/jtwhittington)
         | 
    
        data/area_code_validator.gemspec
    CHANGED
    
    | @@ -7,7 +7,7 @@ Gem::Specification.new do |spec| | |
| 7 7 | 
             
              spec.name          = 'area_code_validator'
         | 
| 8 8 | 
             
              spec.version       = AreaCodeValidator::VERSION
         | 
| 9 9 | 
             
              spec.authors       = ['Andrew Medeiros']
         | 
| 10 | 
            -
              spec.email         = [' | 
| 10 | 
            +
              spec.email         = ['andrew@amedeiros.com']
         | 
| 11 11 | 
             
              spec.description   = %q{AreaCodeValidator is a small gem that validates a phone numbers area code to a state.}
         | 
| 12 12 | 
             
              spec.summary       = %q{AreaCodeValidator is a small gem that validates a phone numbers area code to a state.}
         | 
| 13 13 | 
             
              spec.homepage      = ''
         | 
| @@ -18,7 +18,9 @@ Gem::Specification.new do |spec| | |
| 18 18 | 
             
              spec.test_files    = spec.files.grep(%r{^(test|spec|features)/})
         | 
| 19 19 | 
             
              spec.require_paths = ['lib']
         | 
| 20 20 |  | 
| 21 | 
            -
              spec.add_development_dependency ' | 
| 21 | 
            +
              spec.add_development_dependency 'minitest'
         | 
| 22 | 
            +
              spec.add_development_dependency 'minitest-reporters'
         | 
| 23 | 
            +
              spec.add_development_dependency 'rails', '~> 4.2.0'
         | 
| 22 24 | 
             
              spec.add_development_dependency 'sqlite3'
         | 
| 23 25 | 
             
              spec.add_development_dependency 'bundler', '~> 1.3'
         | 
| 24 26 | 
             
              spec.add_development_dependency 'rake'
         | 
| @@ -62,9 +62,9 @@ module AreaCodeValidator | |
| 62 62 | 
             
                    'AK' => ['907'],
         | 
| 63 63 | 
             
                    'AZ' => ['480', '520', '602', '623', '928'],
         | 
| 64 64 | 
             
                    'AR' => ['479', '501', '870'],
         | 
| 65 | 
            -
                    'CA' => ['209', '213', '310', '323', '408', '415', '424', '442', '510', '530', '559', '562', '619', '626', '650', '657', '661', '707', '714', '747', '760', '805', '818', '831', '858', '909', '916', '925', '949', '951'],
         | 
| 65 | 
            +
                    'CA' => ['209', '213', '310', '323', '408', '415', '424', '442', '510', '530', '559', '562', '619', '626', '628', '650', '657', '661', '707', '714', '747', '760', '805', '818', '831', '858', '909', '916', '925', '949', '951'],
         | 
| 66 66 | 
             
                    'CO' => ['303', '719', '720', '970'],
         | 
| 67 | 
            -
                    'CT' => ['203', '475', '860'],
         | 
| 67 | 
            +
                    'CT' => ['203', '475', '860', '959'],
         | 
| 68 68 | 
             
                    'DE' => ['302'],
         | 
| 69 69 | 
             
                    'DC' => ['202'],
         | 
| 70 70 | 
             
                    'FL' => ['239', '305', '321', '352', '386', '407', '561', '727', '754', '772', '786', '813', '850', '863', '904', '941', '954'],
         | 
| @@ -72,10 +72,10 @@ module AreaCodeValidator | |
| 72 72 | 
             
                    'HI' => ['808'],
         | 
| 73 73 | 
             
                    'ID' => ['208'],
         | 
| 74 74 | 
             
                    'IL' => ['217', '224', '309', '312', '331', '618', '630', '708', '773', '779', '815', '847', '872'],
         | 
| 75 | 
            -
                    'IN' => ['219', '260', '317', '574', '765', '812'],
         | 
| 75 | 
            +
                    'IN' => ['219', '260', '317', '463', '574', '765', '812', '930'],
         | 
| 76 76 | 
             
                    'IA' => ['319', '515', '563', '641', '712'],
         | 
| 77 77 | 
             
                    'KS' => ['316', '620', '785', '913'],
         | 
| 78 | 
            -
                    'KY' => ['270', '502', '606', '859'],
         | 
| 78 | 
            +
                    'KY' => ['270', '364', '502', '606', '859'],
         | 
| 79 79 | 
             
                    'LA' => ['225', '318', '337', '504', '985'],
         | 
| 80 80 | 
             
                    'ME' => ['207'],
         | 
| 81 81 | 
             
                    'MD' => ['240', '301', '410', '443'],
         | 
| @@ -86,23 +86,23 @@ module AreaCodeValidator | |
| 86 86 | 
             
                    'MO' => ['314', '417', '573', '636', '660', '816'],
         | 
| 87 87 | 
             
                    'MT' => ['406'],
         | 
| 88 88 | 
             
                    'NE' => ['308', '402'],
         | 
| 89 | 
            -
                    'NV' => ['702', '775'],
         | 
| 89 | 
            +
                    'NV' => ['702', '725', '775'],
         | 
| 90 90 | 
             
                    'NH' => ['603'],
         | 
| 91 91 | 
             
                    'NJ' => ['201', '551', '609', '732', '848', '856', '862', '908', '973'],
         | 
| 92 | 
            -
                    'NY' => ['212', '315', '347', '516', '518', '585', '607', '631', '646', '716', '718', '845', '914', '917', '929'],
         | 
| 92 | 
            +
                    'NY' => ['212', '315', '347', '516', '518', '585', '607', '631', '646', '680', '716', '718', '845', '914', '917', '929', '934'],
         | 
| 93 93 | 
             
                    'NM' => ['505', '575'],
         | 
| 94 | 
            -
                    'NC' => ['252', '336', '704', '828', '910', '919', '980'],
         | 
| 94 | 
            +
                    'NC' => ['252', '336', '704', '743', '828', '910', '919', '980'],
         | 
| 95 95 | 
             
                    'ND' => ['701'],
         | 
| 96 | 
            -
                    'OH' => ['216', '234', '330', '419', '440', '513', '567', '614', '740', '937'],
         | 
| 96 | 
            +
                    'OH' => ['216', '220', '234', '330', '380', '419', '440', '513', '567', '614', '740', '937'],
         | 
| 97 97 | 
             
                    'OK' => ['405', '539', '580', '918'],
         | 
| 98 98 | 
             
                    'OR' => ['458', '503', '541', '971'],
         | 
| 99 99 | 
             
                    'PA' => ['215', '267', '412', '484', '570', '610', '717', '724', '814', '878'],
         | 
| 100 100 | 
             
                    'PR' => ['787', '939'],
         | 
| 101 101 | 
             
                    'RI' => ['401'],
         | 
| 102 | 
            -
                    'SC' => ['803', '843', '864'],
         | 
| 102 | 
            +
                    'SC' => ['803', '843', '854', '864'],
         | 
| 103 103 | 
             
                    'SD' => ['605'],
         | 
| 104 | 
            -
                    'TN' => ['423', '615', '731', '865', '901', '931'],
         | 
| 105 | 
            -
                    'TX' => ['210', '214', '254', '281', '325', '361', '409', '430', '432', '469', '512', '682', '713', '806', '817', '830', '832', '903', '915', '936', '940', '956', '972', '979'],
         | 
| 104 | 
            +
                    'TN' => ['423', '615', '629', '731', '865', '901', '931'],
         | 
| 105 | 
            +
                    'TX' => ['210', '214', '254', '281', '325', '346', '361', '409', '430', '432', '469', '512', '682', '713', '806', '817', '830', '832', '903', '915', '936', '940', '956', '972', '979'],
         | 
| 106 106 | 
             
                    'UT' => ['385', '435', '801'],
         | 
| 107 107 | 
             
                    'VT' => ['802'],
         | 
| 108 108 | 
             
                    'VI' => ['340'],
         | 
| @@ -1,10 +1,10 @@ | |
| 1 1 | 
             
            require File.expand_path(File.dirname(__FILE__) + '/test_helper')
         | 
| 2 2 |  | 
| 3 | 
            -
            class AreaCodeValidatorTest <  | 
| 3 | 
            +
            class AreaCodeValidatorTest < ActiveSupport::TestCase
         | 
| 4 4 | 
             
              context AreaCodeValidator do
         | 
| 5 5 | 
             
                context '.invalid?' do
         | 
| 6 6 |  | 
| 7 | 
            -
                   | 
| 7 | 
            +
                  VALID_AREA_CODES.each do |state, area_codes_array|
         | 
| 8 8 | 
             
                    area_codes_array.each_with_index do |area_code, index|
         | 
| 9 9 | 
             
                      should "be a valid area code #{area_code} - #{state} index: #{index}" do
         | 
| 10 10 | 
             
                        assert !AreaCodeValidator.invalid?(area_code, state), state.inspect + ' ' + area_code.inspect
         | 
| @@ -12,7 +12,7 @@ class AreaCodeValidatorTest < Test::Unit::TestCase | |
| 12 12 | 
             
                    end
         | 
| 13 13 | 
             
                  end
         | 
| 14 14 |  | 
| 15 | 
            -
                   | 
| 15 | 
            +
                  VALID_AREA_CODES.each do |state, area_codes_array|
         | 
| 16 16 | 
             
                    area_codes_array.each_with_index do |area_code, index|
         | 
| 17 17 | 
             
                      should "not be a valid area_code #{area_code} - #{state} index: #{index}" do
         | 
| 18 18 | 
             
                        assert AreaCodeValidator.invalid?(area_code + '123', state), state.inspect + ' ' + area_code + '123'
         | 
| @@ -32,12 +32,12 @@ class AreaCodeValidatorTest < Test::Unit::TestCase | |
| 32 32 |  | 
| 33 33 | 
             
                  should 'handle a state abbreviation with non-word characters' do
         | 
| 34 34 | 
             
                    state = '12}3 F (** __)L @ 5674``' # FL
         | 
| 35 | 
            -
                    assert !AreaCodeValidator.invalid?( | 
| 35 | 
            +
                    assert !AreaCodeValidator.invalid?(VALID_AREA_CODES['FL'].first, state)
         | 
| 36 36 | 
             
                  end
         | 
| 37 37 |  | 
| 38 38 | 
             
                  should 'handle a full state name with non-word characters' do
         | 
| 39 39 | 
             
                    state = '12_3 F (** )L o # R ^ I !!!! DA @   907' # FLORIDA
         | 
| 40 | 
            -
                    assert !AreaCodeValidator.invalid?( | 
| 40 | 
            +
                    assert !AreaCodeValidator.invalid?(VALID_AREA_CODES['FL'].first, state)
         | 
| 41 41 | 
             
                  end
         | 
| 42 42 |  | 
| 43 43 | 
             
                  should 'handle a state area_code with non-word characters and word characters' do
         | 
| @@ -63,7 +63,7 @@ class AreaCodeValidatorTest < Test::Unit::TestCase | |
| 63 63 | 
             
                end
         | 
| 64 64 |  | 
| 65 65 | 
             
                context '.invalid?' do
         | 
| 66 | 
            -
                   | 
| 66 | 
            +
                  VALID_AREA_CODES.each do |state, area_codes_array|
         | 
| 67 67 | 
             
                    area_codes_array.each_with_index do |area_code, index|
         | 
| 68 68 | 
             
                      should "be a valid area code #{area_code} - #{state} index: #{index}" do
         | 
| 69 69 | 
             
                        assert AreaCodeValidator.valid?(area_code, state), state.inspect + ' ' + area_code.inspect
         | 
| @@ -71,7 +71,7 @@ class AreaCodeValidatorTest < Test::Unit::TestCase | |
| 71 71 | 
             
                    end
         | 
| 72 72 | 
             
                  end
         | 
| 73 73 |  | 
| 74 | 
            -
                   | 
| 74 | 
            +
                  VALID_AREA_CODES.each do |state, area_codes_array|
         | 
| 75 75 | 
             
                    area_codes_array.each_with_index do |area_code, index|
         | 
| 76 76 | 
             
                      should "not be a valid area_code #{area_code} - #{state} index: #{index}" do
         | 
| 77 77 | 
             
                        refute AreaCodeValidator.valid?(area_code + '123', state), state.inspect + ' ' + area_code + '123'
         | 
| 
            File without changes
         | 
| @@ -1,23 +1,31 @@ | |
| 1 1 | 
             
            # Configure Rails Environment
         | 
| 2 2 | 
             
            ENV['RAILS_ENV'] = 'test'
         | 
| 3 3 |  | 
| 4 | 
            -
            require  | 
| 5 | 
            -
            require ' | 
| 6 | 
            -
            require ' | 
| 4 | 
            +
            require 'rails'
         | 
| 5 | 
            +
            require 'active_record'
         | 
| 6 | 
            +
            require 'active_support'
         | 
| 7 | 
            +
            require 'minitest/autorun'
         | 
| 8 | 
            +
            require 'minitest/reporters'
         | 
| 7 9 | 
             
            require 'area_code_validator'
         | 
| 8 10 | 
             
            require 'shoulda'
         | 
| 9 11 |  | 
| 10 | 
            -
             | 
| 12 | 
            +
            ActiveSupport.test_order = :sorted
         | 
| 13 | 
            +
            Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new
         | 
| 11 14 |  | 
| 12 | 
            -
             | 
| 13 | 
            -
             | 
| 14 | 
            -
             | 
| 15 | 
            -
             | 
| 16 | 
            -
             | 
| 17 | 
            -
               | 
| 15 | 
            +
            configuration = Pathname.new File.expand_path('configuration', File.dirname(__FILE__))
         | 
| 16 | 
            +
            models        = Pathname.new File.expand_path('models', File.dirname(__FILE__))
         | 
| 17 | 
            +
            Dir.glob(models.join('*.rb')).each do |file|
         | 
| 18 | 
            +
              autoload File.basename(file).chomp('.rb').camelcase.intern, file
         | 
| 19 | 
            +
            end.each do |file|
         | 
| 20 | 
            +
              require file
         | 
| 18 21 | 
             
            end
         | 
| 19 22 |  | 
| 20 | 
            -
             | 
| 23 | 
            +
            # Setup ActiveRecord
         | 
| 24 | 
            +
            ActiveRecord::Base.configurations = YAML.load_file configuration.join('database.yml')
         | 
| 25 | 
            +
            ActiveRecord::Base.establish_connection
         | 
| 26 | 
            +
            load configuration.join('schema.rb')
         | 
| 27 | 
            +
             | 
| 28 | 
            +
            class ActiveSupport::TestCase
         | 
| 21 29 | 
             
              VALID_AREA_CODES = {
         | 
| 22 30 | 
             
                  'AL' => ['205', '251', '256', '334', '938'],
         | 
| 23 31 | 
             
                  'AK' => ['907'],
         |