]> git.openstreetmap.org Git - rails.git/blobdiff - vendor/gems/rspec-1.1.2/examples/pure/custom_expectation_matchers.rb
Removing rspec from svn, as it isn't being used.
[rails.git] / vendor / gems / rspec-1.1.2 / examples / pure / custom_expectation_matchers.rb
diff --git a/vendor/gems/rspec-1.1.2/examples/pure/custom_expectation_matchers.rb b/vendor/gems/rspec-1.1.2/examples/pure/custom_expectation_matchers.rb
deleted file mode 100644 (file)
index 075bb54..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-module AnimalSpecHelper
-  class Eat
-    def initialize(food)
-      @food = food
-    end
-    
-    def matches?(animal)
-      @animal = animal
-      @animal.eats?(@food)
-    end
-    
-    def failure_message
-      "expected #{@animal} to eat #{@food}, but it does not"
-    end
-    
-    def negative_failure_message
-      "expected #{@animal} not to eat #{@food}, but it does"
-    end
-  end
-    
-  def eat(food)
-    Eat.new(food)
-  end
-end
-
-module Animals
-  class Animal
-    def eats?(food)
-      return foods_i_eat.include?(food)
-    end
-  end
-  
-  class Mouse < Animal
-    def foods_i_eat
-      [:cheese]
-    end
-  end
-
-  describe Mouse do
-    include AnimalSpecHelper
-    before(:each) do
-      @mouse = Animals::Mouse.new
-    end
-  
-    it "should eat cheese" do
-      @mouse.should eat(:cheese)
-    end
-  
-    it "should not eat cat" do
-      @mouse.should_not eat(:cat)
-    end
-  end
-
-end