Permalink
Browse files

removed zip_plus_4

  • Loading branch information...
jbrowning committed May 6, 2012
1 parent 213d28b commit e42308ada6d56353918e4c58d2b904c13a0af019
Showing with 23 additions and 23 deletions.
  1. +9 −9 lib/active_shipping/shipping/location.rb
  2. +14 −14 test/unit/location_test.rb
@@ -133,15 +133,15 @@ def inspect
end
# Returns the postal code as a properly formatted Zip+4 code, e.g. "77095-2233"
- def zip_plus_4
- if /(?<zip>\d{5})(?<plus_4>\d{4})/ =~ @postal_code
- return "#{zip}-#{plus_4}"
- elsif /\d{5}-\d{4}/ =~ @postal_code
- return @postal_code
- else
- nil
- end
- end
+ # def zip_plus_4
+ # if /(?<zip>\d{5})(?<plus_4>\d{4})/ =~ @postal_code
+ # return "#{zip}-#{plus_4}"
+ # elsif /\d{5}-\d{4}/ =~ @postal_code
+ # return @postal_code
+ # else
+ # nil
+ # end
+ # end
end
View
@@ -99,19 +99,19 @@ def test_custom_root_to_xml
assert_equal @locations[:ottawa].to_hash, Hash.from_xml(location_xml)["destination"].symbolize_keys
end
- def test_zip_plus_4_with_no_dash
- zip = "33333"
- plus_4 = "1234"
- zip_plus_4 = "#{zip}-#{plus_4}"
- location = Location.from(:zip => zip+plus_4)
- assert_equal zip_plus_4, location.zip_plus_4
- end
+ # def test_zip_plus_4_with_no_dash
+ # zip = "33333"
+ # plus_4 = "1234"
+ # zip_plus_4 = "#{zip}-#{plus_4}"
+ # location = Location.from(:zip => zip+plus_4)
+ # assert_equal zip_plus_4, location.zip_plus_4
+ # end
- def test_zip_plus_4_with_dash
- zip = "33333"
- plus_4 = "1234"
- zip_plus_4 = "#{zip}-#{plus_4}"
- location = Location.from(:zip => zip_plus_4)
- assert_equal zip_plus_4, location.zip_plus_4
- end
+ # def test_zip_plus_4_with_dash
+ # zip = "33333"
+ # plus_4 = "1234"
+ # zip_plus_4 = "#{zip}-#{plus_4}"
+ # location = Location.from(:zip => zip_plus_4)
+ # assert_equal zip_plus_4, location.zip_plus_4
+ # end
end

0 comments on commit e42308a

Please sign in to comment.