Permalink
Browse files

rspec

  • Loading branch information...
1 parent 4c9fa08 commit 07cb5240f5a5f9b648f6cc327015eecf1fc2fa20 @liweinan committed Mar 10, 2013
Showing with 26 additions and 0 deletions.
  1. +7 −0 ruby/rspec/start/Makefile
  2. +8 −0 ruby/rspec/start/bowling.rb
  3. +11 −0 ruby/rspec/start/bowling_spec.rb
@@ -0,0 +1,7 @@
+RSPEC_OPT='-fd'
+
+.PHONY: test
+test: bowling.rb bowling_spec.rb
+ @$(rb19)
+ @rspec bowling_spec.rb $(RSPEC_OPT)
+
@@ -0,0 +1,8 @@
+class Bowling
+ def hit(pins)
+ end
+
+ def score
+ 0
+ end
+end
@@ -0,0 +1,11 @@
+require './bowling.rb'
+
+describe Bowling, "#score" do
+ it "returns 0 for all gutter game" do
+ bowling = Bowling.new
+ 20.times { bowling.hit(0) }
+ bowling.score.should eq(0)
+ end
+end
+
+

0 comments on commit 07cb524

Please sign in to comment.