Permalink
Browse files

meep

  • Loading branch information...
1 parent aef5fac commit fcba5ef9e09aa966edf18fbabf6cff4a94616841 @CodeOfficer committed Jun 25, 2009
Showing with 47 additions and 3 deletions.
  1. +22 −0 bin/game.rb
  2. +5 −0 lib/game.rb
  3. +15 −2 spec/game_spec.rb
  4. +5 −1 spec/spec_helper.rb
View
@@ -8,4 +8,26 @@
game = Game.new
+
+map = Map.new
+
+game.add_map(map) do |map|
+ # map.place(3, 0, nathan)
+ # map.place(4, 0, vik)
+ # map.place(5, 0, winston)
+ #
+ # vr1 = VRaptor.new(computer, 'Velociraptor 1')
+ # vr2 = VRaptor.new(computer, 'Velociraptor 2')
+ # vr3 = VRaptor.new(computer, 'Velociraptor 3')
+ #
+ # computer.clear_units
+ # computer.add_unit(vr1)
+ # computer.add_unit(vr2)
+ # computer.add_unit(vr3)
+ #
+ # map.place(0, 5, vr1)
+ # map.place(1, 5, vr2)
+ # map.place(2, 5, vr3)
+end
+
game.run
View
@@ -1,6 +1,7 @@
class Game
attr_reader :running
+ attr_reader :map
def initialize(*args)
@running = false
@@ -10,4 +11,8 @@ def run
@running = true
end
+ def add_map(map, &block)
+ @map = map
+ end
+
end
View
@@ -1,7 +1,7 @@
require File.expand_path(File.join('.', 'spec_helper'), File.dirname(__FILE__))
describe Game, "When I create a game, it" do
-
+
before(:each) do
@game = Game.new
end
@@ -11,6 +11,19 @@
@game.running.should == true
end
- it "should make your mom jealous"
+ context "has a map and ... " do
+
+ before(:each) do
+ @map = Map.new
+ end
+
+ it "should have a map" do
+ @game.add_map(@map) do |map|
+ # ...
+ end
+ @game.map.should be_an_instance_of Map
+ end
+
+ end
end
View
@@ -7,4 +7,8 @@
__END__
-Nothing below this line will get run. Wicked cool!
+Nothing below this line will get run. Wicked cool!
+
+rspec cheat sheet:
+
+http://cheat.errtheblog.com/s/rspec/

0 comments on commit fcba5ef

Please sign in to comment.