Class: Mcll4rTest
- Inherits:
-
Test::Unit::TestCase
- Object
- Test::Unit::TestCase
- Mcll4rTest
- Defined in:
- lib/mcll4r/mcll4r_test.rb
Instance Method Summary collapse
- #setup ⇒ Object
- #test_assert_raise_on_district_not_found ⇒ Object
- #test_assert_raise_on_error ⇒ Object
- #test_assert_we_get_back_correct_district_data ⇒ Object
Instance Method Details
#setup ⇒ Object
6 7 8 |
# File 'lib/mcll4r/mcll4r_test.rb', line 6 def setup @mcll4r = Mcll4r.new end |
#test_assert_raise_on_district_not_found ⇒ Object
29 30 31 32 33 |
# File 'lib/mcll4r/mcll4r_test.rb', line 29 def test_assert_raise_on_district_not_found assert_raise DistrictNotFound do @mcll4r.district_lookup( 1.0, 1.0 ) end end |
#test_assert_raise_on_error ⇒ Object
23 24 25 26 27 |
# File 'lib/mcll4r/mcll4r_test.rb', line 23 def test_assert_raise_on_error assert_raise DistrictNotFound do @mcll4r.district_lookup(nil,nil) end end |
#test_assert_we_get_back_correct_district_data ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/mcll4r/mcll4r_test.rb', line 10 def test_assert_we_get_back_correct_district_data expected = { "response" => { "state_upper" => { "district" => "029", "display_name" => "TX 29th", "state" => "TX" }, "federal" => { "district" => "16", "display_name" => "TX 16th", "state" => "TX" }, "state_lower" => { "district" => "077", "display_name" => "TX 77th", "state" => "TX" }, "lng" => "-106.490969", "lat" => "31.76321" } } assert_equal expected, @mcll4r.district_lookup(31.76321, -106.490969) end |