Permalink
Browse files

Version6

Further Red -> Green -> Refactor.
  • Loading branch information...
jenkoian committed Oct 6, 2014
1 parent 3dab522 commit bc7dc0840e634ab22475aee1d5b97a7ad5221427
@@ -45,4 +45,10 @@ function it_should_set_location()
$this->whereAmI()->shouldBe($location);
}
function it_should_allow_entering_rooms()
{
$room = Room::named('kitchen');
$this->enterRoom($room);
}
}
@@ -57,4 +57,12 @@ public function whereAmI()
{
return $this->currentLocation;
}
/**
* @param Location $room
*/
public function enterRoom(Location $room)
{
$this->currentLocation = $room;
}
}
@@ -24,4 +24,4 @@ public function getName()
{
return $this->name;
}
}
}
@@ -27,6 +27,12 @@ public function __construct()
*/
public function iAmInThe($location)
{
if (false !== strpos('garden', $location)) {
$location = Room::named($location);
} else {
$location = Garden::named($location);
}
$this->house->setLocation($location);
}

0 comments on commit bc7dc08

Please sign in to comment.