aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2015-04-11 16:36:46 -0400
committerTeddy Wing2015-04-11 16:36:46 -0400
commit4f027d92648bdd2cc11a06490283540740b8676e (patch)
tree3f30b340da631db3d35bce9bc395e5d218ec6063
parentfcc227c2c7e8f409dc286c9f00a4395b7cc8133c (diff)
downloadtic-tac-toe-4f027d92648bdd2cc11a06490283540740b8676e.tar.bz2
Board#render: return output instead of printing
Don't print the grid directly. We'll do this in a separate display method or game loop area.
-rw-r--r--board.rb2
-rw-r--r--spec/board_spec.rb6
2 files changed, 2 insertions, 6 deletions
diff --git a/board.rb b/board.rb
index 9481d45..93b726a 100644
--- a/board.rb
+++ b/board.rb
@@ -8,6 +8,6 @@ class Board
end
def render
- puts "...\n" * 3
+ "...\n" * 3
end
end
diff --git a/spec/board_spec.rb b/spec/board_spec.rb
index 1370c10..86b4276 100644
--- a/spec/board_spec.rb
+++ b/spec/board_spec.rb
@@ -7,11 +7,7 @@ describe Board do
describe '#render' do
it 'prints a grid' do
- out, err = capture_io do
- @board.render
- end
-
- out.must_equal <<EOF
+ @board.render.must_equal <<EOF
...
...
...