Sha256: 87d771d327d5aafea1ff15092cd90ea12dfbe0f626bed762150db304d26b512e

Contents?: true

Size: 844 Bytes

Versions: 38

Compression:

Stored size: 844 Bytes

Contents

require 'spec_helper'

module RSpec
  module Mocks
    describe "Methods added to every object" do
      include_context "with syntax", :expect

      def added_methods
        host = Class.new
        orig_instance_methods = host.instance_methods
        Syntax.enable_should(host)
        (host.instance_methods - orig_instance_methods).map(&:to_sym)
      end

      it 'limits the number of methods that get added to all objects' do
        # If really necessary, you can add to this list, but long term,
        # we are hoping to cut down on the number of methods added to all objects
        expect(added_methods).to match_array([
          :as_null_object, :null_object?,
          :received_message?, :should_not_receive, :should_receive,
          :stub, :stub!, :stub_chain, :unstub, :unstub!
        ])
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 8 rubygems

Version Path
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.4.0/gems/rspec-mocks-2.14.6/spec/rspec/mocks/methods_spec.rb
vagrant-unbundled-1.9.5.1 vendor/bundle/ruby/2.4.0/gems/rspec-mocks-2.14.6/spec/rspec/mocks/methods_spec.rb
vagrant-unbundled-1.9.1.1 vendor/bundle/ruby/2.4.0/gems/rspec-mocks-2.14.6/spec/rspec/mocks/methods_spec.rb
vagrant-unbundled-1.8.5.2 vendor/bundle/ruby/2.3.0/gems/rspec-mocks-2.14.6/spec/rspec/mocks/methods_spec.rb
vagrant-unbundled-1.8.5.1 vendor/bundle/ruby/2.3.0/gems/rspec-mocks-2.14.6/spec/rspec/mocks/methods_spec.rb
vagrant-unbundled-1.8.4.2 vendor/bundle/ruby/2.3.0/gems/rspec-mocks-2.14.6/spec/rspec/mocks/methods_spec.rb
vagrant-unbundled-1.8.4.1 vendor/bundle/ruby/2.3.0/gems/rspec-mocks-2.14.6/spec/rspec/mocks/methods_spec.rb
vagrant-unbundled-1.8.1.1 vendor/bundle/ruby/2.3.0/gems/rspec-mocks-2.14.6/spec/rspec/mocks/methods_spec.rb
rspec-mocks-2.99.4 spec/rspec/mocks/methods_spec.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/rspec-mocks-2.14.6/spec/rspec/mocks/methods_spec.rb
rspec-mocks-2.99.3 spec/rspec/mocks/methods_spec.rb
rspec-mocks-2.99.2 spec/rspec/mocks/methods_spec.rb
dxruby_rp5-0.0.4 spec/vendor/rspec-mocks-2.14.4/spec/rspec/mocks/methods_spec.rb
rspec-mocks-2.99.1 spec/rspec/mocks/methods_spec.rb
rspec-mocks-2.99.0 spec/rspec/mocks/methods_spec.rb
rspec-mocks-2.99.0.rc1 spec/rspec/mocks/methods_spec.rb
rspec-mocks-2.14.6 spec/rspec/mocks/methods_spec.rb
rspec-mocks-2.99.0.beta2 spec/rspec/mocks/methods_spec.rb
rspec-mocks-2.14.5 spec/rspec/mocks/methods_spec.rb
mango-0.8.0 vendor/bundler/ruby/2.1.0/gems/rspec-mocks-2.14.4/spec/rspec/mocks/methods_spec.rb