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-dev-0.12.1dev-java lib/openssl/mocha/lib/mocha/single_return_value.rb
redcar-dev-0.12.0dev-java lib/openssl/mocha/lib/mocha/single_return_value.rb
redcar-0.11 lib/openssl/mocha/lib/mocha/single_return_value.rb
redcar-0.11.0dev lib/openssl/mocha/lib/mocha/single_return_value.rb
redcar-0.10 lib/openssl/mocha/lib/mocha/single_return_value.rb
redcar-0.9.2 lib/openssl/mocha/lib/mocha/single_return_value.rb
redcar-0.9.1 lib/openssl/mocha/lib/mocha/single_return_value.rb
redcar-0.9.0 lib/openssl/mocha/lib/mocha/single_return_value.rb
redcar-0.8.1 lib/openssl/mocha/lib/mocha/single_return_value.rb
redcar-0.8 lib/openssl/mocha/lib/mocha/single_return_value.rb
redcar-0.7 lib/openssl/mocha/lib/mocha/single_return_value.rb
redcar-0.6.1 lib/openssl/mocha/lib/mocha/single_return_value.rb
redcar-0.6 lib/openssl/mocha/lib/mocha/single_return_value.rb
redcar-0.6.1dev lib/openssl/mocha/lib/mocha/single_return_value.rb
redcar-0.5.1 lib/openssl/mocha/lib/mocha/single_return_value.rb
redcar-0.5 lib/openssl/mocha/lib/mocha/single_return_value.rb
redcar-0.5.6dev lib/openssl/mocha/lib/mocha/single_return_value.rb
redcar-0.5.5dev lib/openssl/mocha/lib/mocha/single_return_value.rb
redcar-0.5.4dev lib/openssl/mocha/lib/mocha/single_return_value.rb
redcar-0.5.3dev lib/openssl/mocha/lib/mocha/single_return_value.rb