test/test_bridge.rb in bridge-0.0.19 vs test/test_bridge.rb in bridge-0.0.20

- old
+ new

@@ -20,6 +20,22 @@ assert_equal "NS", Bridge.side_of("S") assert_equal "NS", Bridge.side_of("N") assert_equal "EW", Bridge.side_of("W") assert_equal "EW", Bridge.side_of("E") end + + test "return next direction" do + assert_equal "E", Bridge.next_direction("N") + assert_equal "S", Bridge.next_direction("E") + assert_equal "W", Bridge.next_direction("S") + assert_equal "N", Bridge.next_direction("W") + assert_equal "N", Bridge.next_direction(nil) + end + + test "return next vulnerable" do + assert_equal "NONE", Bridge.next_vulnerable("BOTH") + assert_equal "NS", Bridge.next_vulnerable("NONE") + assert_equal "EW", Bridge.next_vulnerable("NS") + assert_equal "BOTH", Bridge.next_vulnerable("EW") + assert_equal "BOTH", Bridge.next_vulnerable(nil) + end end