Skip to content

Commit

Permalink
Adjusts test expectations to reflect updated directions, initializes …
Browse files Browse the repository at this point in the history
…some instance variables as nil
  • Loading branch information
Chris Vannoy committed Aug 16, 2016
1 parent fd7dd76 commit c4be285
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lib/google_directions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ def initialize(origin, destination, opts=@@default_options)
@xml = open(@url).read
@doc = Nokogiri::XML(@xml)
@status = @doc.css('status').text
@distance_text = nil
@distance = nil
end

def xml_call
Expand Down
4 changes: 2 additions & 2 deletions test/unit/google_directions_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ def test_french_direction
def test_steps
directions = GoogleDirections.new("rue poissonnière, 75002 Paris", "51 rue de Turbigo, 75003 Paris France")
assert_equal Array, directions.steps.class
assert_equal 5, directions.steps.size
assert_equal 4, directions.steps.size
end

def test_distance_text
directions = GoogleDirections.new("Place du Maquis du Vercors PARIS-19EME", "rue poissoniere 75002 paris")
assert_equal String, directions.distance_text.class
assert_equal "6.5 km", directions.distance_text
assert_equal "6.1 km", directions.distance_text
end

def test_zero_distance_text
Expand Down

0 comments on commit c4be285

Please sign in to comment.