Module Spec::Mocks::Methods

  1. lib/spec/mocks/methods.rb

Public instance methods

as_null_object ()
[show source]
# File lib/spec/mocks/methods.rb, line 32
      def as_null_object
        __mock_proxy.as_null_object
      end
null_object? ()
[show source]
# File lib/spec/mocks/methods.rb, line 36
      def null_object?
        __mock_proxy.null_object?
      end
should_not_receive (sym, &block)
[show source]
# File lib/spec/mocks/methods.rb, line 8
      def should_not_receive(sym, &block)
        __mock_proxy.add_negative_message_expectation(caller(1)[0], sym.to_sym, &block)
      end
should_receive (sym, opts={}, &block)
[show source]
# File lib/spec/mocks/methods.rb, line 4
      def should_receive(sym, opts={}, &block)
        __mock_proxy.add_message_expectation(opts[:expected_from] || caller(1)[0], sym.to_sym, opts, &block)
      end
stub! (sym_or_hash, opts={})
[show source]
# File lib/spec/mocks/methods.rb, line 12
      def stub!(sym_or_hash, opts={})
        if Hash === sym_or_hash
          sym_or_hash.each {|method, value| stub!(method).and_return value }
        else
          __mock_proxy.add_stub(caller(1)[0], sym_or_hash.to_sym, opts)
        end
      end