Commit 90847d0

mo khan <mo@mokhan.ca>
2015-01-24 19:01:24
upgrade maze and dijkstra specs.
1 parent e1fe68f
Changed files (2)
spec/practice/recursive_maze_spec.rb
@@ -40,7 +40,7 @@ def is_maze_solveable(maze)
 end
 
 describe "maze" do
-  it "should be solvable" do
+  it "is solvable" do
     maze = Array.new(8) { Array.new(8) { " " } }
     8.times { |n| maze[n][0] = "*" if (0...5).include?(n) } # row 1
     maze[0][1] = maze[4][1] = "*" # row 2
@@ -55,6 +55,6 @@ describe "maze" do
     maze[6][6] = "E"
     print_maze(maze)
 
-    is_maze_solveable(maze).should be_true
+    expect(is_maze_solveable(maze)).to be_truthy
   end
 end
spec/searching/dijkstra_spec.rb
@@ -44,12 +44,12 @@ describe "dijkstra" do
     graph.connect(e, b, 3)
   end
 
-  it "A-B-C should == 9" do
-    dijkstra(graph, a, c).should == 9
+  it "A-B-C equals 9" do
+    expect(dijkstra(graph, a, c)).to eql(9)
   end
 
-  it "A-D should == 5" do
-    dijkstra(graph, a, d).should == 5
+  it "A-D equals 5" do
+    expect(dijkstra(graph, a, d)).to eql(5)
   end
 
   def node(details)