Permalink
Browse files

REFACTOR Improve design by moving code

The Rules allow us to move code to improve its structure.  This is not
really refactoring in the strictest sense, as it changes the behaviour
of the function (whereas refactoring should preserve behaviour).
However, the tests all still pass and this has given us a way to improve
the design.
  • Loading branch information...
matatk committed Mar 3, 2015
1 parent 7940ebb commit ac29b93507fe4dd1367043ffe0d7214b00be3f41
Showing with 2 additions and 2 deletions.
  1. +2 −2 nac.py
View
4 nac.py
@@ -10,8 +10,8 @@ def test_illegal_move_is_not_legal():
def test_different_legal_move_is_legal():
move = 1
assert is_legal(move) or move > 0
assert is_legal(move)
def is_legal(move):
return move == 0
return move == 0 or move > 0

0 comments on commit ac29b93

Please sign in to comment.