Permalink
Browse files

Cache Coordinate#possible_coordinates

  • Loading branch information...
1 parent be4bcad commit 061571985a2bda6fa8452c2e94e7f59eb76fda78 @alex-tan committed Feb 5, 2013
@@ -114,7 +114,7 @@ def in_bounds?(x, y)
end
def possible_coordinates
- 0..7
+ @possible_coordinates ||= 0..7
end
end
end
@@ -21,7 +21,7 @@ def initialize(options = {})
@color = options[:color].to_sym
@starting_position = options[:starting_position].to_sym
end
-
+
# Pieces are equal if their class, color, and starting position are
# the same.
# @return [Boolean]
@@ -47,6 +47,7 @@ module RubyChessBoard
end
let(:game) { build(:game, boards: [board]) }
+
let(:collection) do
build :coordinate_collection,
sets: original_sets,

0 comments on commit 0615719

Please sign in to comment.