From 2df991b1976d4ce041150f1c5075acef45f94d79 Mon Sep 17 00:00:00 2001 From: Brian Dorton Date: Fri, 27 Apr 2012 12:19:02 -0500 Subject: [PATCH 1/5] Update zoo.rb --- zoo.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/zoo.rb b/zoo.rb index 8f5eea5..3fe90bc 100644 --- a/zoo.rb +++ b/zoo.rb @@ -52,7 +52,15 @@ def full? end end -class Zookeeper +class Human + include Animal + + def acceptable_food + [:bacon, :tacos] + end +end + +class Zookeeper < Human def feed(args={}) food = args.fetch(:food) panda = args.fetch(:to) From 029f35e59f3e3ce302491b37dd8408499b10e471 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 27 Apr 2012 13:27:38 -0500 Subject: [PATCH 2/5] Feature: Test Commit --- zoo.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zoo.rb b/zoo.rb index 3fe90bc..1c03fa8 100644 --- a/zoo.rb +++ b/zoo.rb @@ -1,6 +1,6 @@ #Zoo -module Animal +module Mammal def eat(food) @meals ||= 0 @@ -28,7 +28,7 @@ def full? class Panda - include Animal + include Mammal def acceptable_food [:bamboo] @@ -41,7 +41,7 @@ def full? end class Lion - include Animal + include Mammal def acceptable_food [:wildebeests, :zeebras] @@ -53,7 +53,7 @@ def full? end class Human - include Animal + include Mammal def acceptable_food [:bacon, :tacos] From 20b4b297f065c77c68fe390eebe4ef1ba1bd15da Mon Sep 17 00:00:00 2001 From: dorton Date: Fri, 27 Apr 2012 13:30:57 -0500 Subject: [PATCH 3/5] Feature: Test Commit --- zoo.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zoo.rb b/zoo.rb index 1c03fa8..3fe90bc 100644 --- a/zoo.rb +++ b/zoo.rb @@ -1,6 +1,6 @@ #Zoo -module Mammal +module Animal def eat(food) @meals ||= 0 @@ -28,7 +28,7 @@ def full? class Panda - include Mammal + include Animal def acceptable_food [:bamboo] @@ -41,7 +41,7 @@ def full? end class Lion - include Mammal + include Animal def acceptable_food [:wildebeests, :zeebras] @@ -53,7 +53,7 @@ def full? end class Human - include Mammal + include Animal def acceptable_food [:bacon, :tacos] From 74d1e46e81feee03df453b024c6d2bff2b1f853e Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 27 Apr 2012 22:41:06 -0500 Subject: [PATCH 4/5] Feature: Test Commit --- zoo.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zoo.rb b/zoo.rb index 3fe90bc..1c03fa8 100644 --- a/zoo.rb +++ b/zoo.rb @@ -1,6 +1,6 @@ #Zoo -module Animal +module Mammal def eat(food) @meals ||= 0 @@ -28,7 +28,7 @@ def full? class Panda - include Animal + include Mammal def acceptable_food [:bamboo] @@ -41,7 +41,7 @@ def full? end class Lion - include Animal + include Mammal def acceptable_food [:wildebeests, :zeebras] @@ -53,7 +53,7 @@ def full? end class Human - include Animal + include Mammal def acceptable_food [:bacon, :tacos] From 45c1cf96c5b7097a78879d3657746eff8868db7f Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 27 Apr 2012 23:17:42 -0500 Subject: [PATCH 5/5] Feature: Human Loves Bacon --- zoo.rb | 8 ++++---- zoo_spec.rb | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/zoo.rb b/zoo.rb index 1c03fa8..3fe90bc 100644 --- a/zoo.rb +++ b/zoo.rb @@ -1,6 +1,6 @@ #Zoo -module Mammal +module Animal def eat(food) @meals ||= 0 @@ -28,7 +28,7 @@ def full? class Panda - include Mammal + include Animal def acceptable_food [:bamboo] @@ -41,7 +41,7 @@ def full? end class Lion - include Mammal + include Animal def acceptable_food [:wildebeests, :zeebras] @@ -53,7 +53,7 @@ def full? end class Human - include Mammal + include Animal def acceptable_food [:bacon, :tacos] diff --git a/zoo_spec.rb b/zoo_spec.rb index 4943c90..ee23c07 100644 --- a/zoo_spec.rb +++ b/zoo_spec.rb @@ -62,6 +62,21 @@ end end +describe Human do + it "should like bacon" do + Human.new.likes?(:bacon).should eq(true) + end + + it "should like tacos" do + Human.new.likes?(:tacos).should eq(true) + end + + it "should not like bamboo" do + Human.new.likes?(:bamboo).should eq(false) + end +end + + describe Zookeeper do it "should be able to feed bamboo to the pandas" do panda = Panda.new