         Klass.class_method(1).should.equal("one")             # forces a check for duplicate expectations
         Klass.class_method(2).should.equal("two")             # otherwise we'll get a 'class_method not called' error
 
-    it "allows the same expectation of the same class method on different classes", ->
+    it "allows the same expectation of the same method on different classes", ->
       class Klass1
         @class_method: -> "class method 1"
       class Klass2

        m.my_method()   # otherwise we'll get a 'my_method() not called' error
    catch
      # eat the error thrown by throws()
                                   
  it "throws an error if no 'error' argument is specified", ->
    (->
      mock (m) ->
        m.expects("my_method").throws()
    ).should.throw(format(messages.ThrowsUsage))
    
  it "throws an error if more than one argument is specified", ->
    (->
      mock (m) ->
        m.expects("my_method").throws(new Error("error 1"), new Error("error 2"))
    ).should.throw(format(messages.ThrowsUsage))

  it "throws an error if throws() has already been specified", ->
    (->
      mock (m) ->
        m.expects("my_method").throws("an error").throws("another error")
    ).should.throw(format(messages.ThrowsUsedMoreThanOnce))

  it "throws an error if a return value has already been specified", ->
    (->
      mock (m) ->
        m.expects("my_method").returns(42).throws(new Error("an error"))
    ).should.throw(format(messages.ReturnsAndThrowsBothUsed))

  it "does not throw an error if a return value has been previously set on the same method with a different expectation", ->
    mock (m) ->
      m.expects("my_method").args(1,2,3).returns(42)
      m.expects("my_method").args(4,5,6).throws(new Error("an error"))
      m.my_method(1,2,3)
      (-> m.my_method(4,5,6) ).should.throw("an error")

  it "can be called after args()", ->
    (->
      mock (m) ->
        m.expects("my_method").args(1,2,3).throws(new Error("an error"))
        m.my_method(1,2,3)
    ).should.throw("an error")

  it "cannot be called more than once on the same expectation", ->
    (->
      mock (m) ->
        m.expects("my_method").throws(new Error("error1"))
        m.expects("my_method").throws(new Error("error1"))
        m.my_method()
    ).should.throw(format(messages.DuplicateExpectation, "my_method", ""))


describe "my_method( [ arg ... ] )", ->
  
  it "does not throw an error if a method is called without arguments and none were expected", ->
    mock (m) ->
      m.expects("my_method")
      m.my_method()
  
  it "does not throw an error if a method is called with arguments that were expected", ->
    mock (m) ->
      m.expects("my_method").args(1,2,3)
      m.my_method(1,2,3)
  
  it "throws an error if an unexpected method is called", ->
    (->
      mock (m) ->
        m.my_method()
    ).should.throw("has no method 'my_method'")
  
  it "throws an error if a method is called without arguments but some were expected", ->
    (->
      mock (m) ->
        m.expects("my_method").args(1,2,3)
        m.my_method()
    ).should.throw(format(messages.UnknownExpectation, "my_method", ""))
  
  it "throws an error if a method is called with argments but none were expected", ->
    (->
      mock (m) ->
        m.expects("my_method")
        m.my_method(1,2,3)
    ).should.throw(format(messages.UnknownExpectation, "my_method", "1,2,3"))
  
  it "throws an error if a method is called with arguments but different arguments were expected", ->
    (->
      mock (m) ->
        m.expects("my_method").args(1,2,3)
        m.my_method(4,5,6)
    ).should.throw(format(messages.UnknownExpectation, "my_method", "4,5,6"))

  it "returns the value specified in a returns()", ->
    mock (m) ->

        m.should.not.respondTo("my_method")



describe "general behaviour", ->

  describe "mocking a class method", ->

    it "allows different expectations of the same method on a class", ->
      class Klass
        @class_method: -> "class method"
      mock ->
