/
path_evaluator_spec.rb
55 lines (43 loc) · 1.33 KB
/
path_evaluator_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
require 'pry'
require_relative '../spec_helper'
require_relative '../../lib/graph/db'
require_relative '../../lib/graph/db_utils'
require_relative '../../lib/graph/airport'
require_relative '../../lib/graph/flight_graph'
require_relative '../../lib/file_parser'
require_relative '../../lib/graph/path_evaluator'
describe "graph paths" do
before do
Neo4jDbUtils.new_temp_db
@graph = FlightGraph.new
@flights = FileParser.load_input_file
@graph.create_flights_from_array_hash(@flights[1])
@a = Airport.find('name: A').first
end
after do
puts "shutting Neo4j down; end of test"
Neo4j.shutdown
Neo4jDbUtils.rm_db_storage
end
describe "evaluating a path" do
it "should reject short paths that don't connect to the end airport" do
paths = @a.outgoing(:flies_to).depth(:all).unique(:node_path).eval_paths { |path|
PathEvaluator.evaluate_path(path)
}
binding.pry
fail "not implemented properly yet"
end
it "should find paths from A to Z" do
fail "not implemented"
end
it "shouldn't find a connecting flight takeoff BEFORE previous landing" do
fail "not implemented"
end
it "should find the cheapest flight" do
fail "not implemented"
end
it "should find the quickest flights" do
fail "not implemented"
end
end
end