 
       @actual? and @actual.then?
 
+    toBeSamePromise: (promise) ->
+      notText = if @isNot then " not" else ""
+      @message = ->
+        "Expected #{@actual}#{notText} to be #{promise}"
+
+      @actual is promise
+
 
 global.promise = (promise) ->
   should = (msg, block) ->
     it "the returned promise should #{msg}", ->
       ended = false
       runs ->
-        promise.call(this)
+        (promise?.call(this) or @promise or @subject)
         .then =>
           block.apply(this, arguments)
           ended = true

      ended = false
      expectedResult = block.call this
      runs ->
        promise.call(this)
        .then (result) ->
          expect(result).toEqual(expectedResult)
          ended = true

    it "the returned promise should fail with #{msg}", ->
      ended = false
      runs ->
        (promise?.call(this) or @promise or @subject)
        .then =>
          block.apply(this, arguments)
          ended = true
