Sha256: 54cad9142127f6eda3c3e43ee44576600f5fea3b195a97c2afe84680d1fd2e09

Contents?: true

Size: 465 Bytes

Versions: 51

Compression:

Stored size: 465 Bytes

Contents

require 'mocha/is_a'
require 'mocha/deprecation'

module Mocha # :nodoc:
  
  class SingleReturnValue # :nodoc:
    
    def initialize(value)
      @value = value
    end
    
    def evaluate
      if @value.__is_a__(Proc) then
        message = 'use of Expectation#returns with instance of Proc - see Expectation#returns RDoc for alternatives'
        Deprecation.warning(message)
        @value.call
      else
        @value
      end
    end
    
  end
  
end

Version data entries

51 entries across 51 versions & 4 rubygems

Version Path
redcar-0.5.2dev lib/openssl/mocha/lib/mocha/single_return_value.rb
redcar-0.5.1dev lib/openssl/mocha/lib/mocha/single_return_value.rb
redcar-0.4.1 lib/openssl/mocha/lib/mocha/single_return_value.rb
redcar-0.4 lib/openssl/mocha/lib/mocha/single_return_value.rb
redcar-0.3.10.1dev lib/openssl/mocha/lib/mocha/single_return_value.rb
redcar-0.3.10.0dev lib/openssl/mocha/lib/mocha/single_return_value.rb
redcar-0.3.9 lib/openssl/mocha/lib/mocha/single_return_value.rb
redcar-0.3.9.0dev lib/openssl/mocha/lib/mocha/single_return_value.rb
redcar-0.3.8.4 lib/openssl/mocha/lib/mocha/single_return_value.rb
redcar-0.3.8.3 lib/openssl/mocha/lib/mocha/single_return_value.rb
redcar-0.3.8.2 lib/openssl/mocha/lib/mocha/single_return_value.rb
redcar-0.3.8.1 lib/openssl/mocha/lib/mocha/single_return_value.rb
redcar-0.3.8 lib/openssl/mocha/lib/mocha/single_return_value.rb
redcar-0.3.7.1 lib/openssl/mocha/lib/mocha/single_return_value.rb
redcar-0.3.7 lib/openssl/mocha/lib/mocha/single_return_value.rb
redcar-0.3.6 lib/openssl/mocha/lib/mocha/single_return_value.rb
redcar-0.3.5 lib/openssl/mocha/lib/mocha/single_return_value.rb
redcar-0.3.4.3 lib/openssl/mocha/lib/mocha/single_return_value.rb
redcar-0.3.4.2 lib/openssl/mocha/lib/mocha/single_return_value.rb
redcar-0.3.4.1 lib/openssl/mocha/lib/mocha/single_return_value.rb