Sha256: 5ea93e78c81196ad1110cbb7f0173ba5c588f130481de084f01199673d000684

Contents?: true

Size: 808 Bytes

Versions: 9

Compression:

Stored size: 808 Bytes

Contents

module RSpec
  module Mocks
    RSpec.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_chain, :unstub
        ])
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
opal-rspec-0.6.2 rspec-mocks/spec/rspec/mocks/methods_spec.rb
opal-rspec-0.6.1 rspec-mocks/spec/rspec/mocks/methods_spec.rb
opal-rspec-0.6.0 rspec-mocks/spec/rspec/mocks/methods_spec.rb
opal-rspec-0.6.0.beta1 rspec-mocks/spec/rspec/mocks/methods_spec.rb
opal-connect-rspec-0.5.0 rspec-mocks/spec/rspec/mocks/methods_spec.rb
opal-rspec-0.5.0 rspec-mocks/spec/rspec/mocks/methods_spec.rb
opal-rspec-0.5.0.beta3 rspec-mocks/spec/rspec/mocks/methods_spec.rb
opal-rspec-0.5.0.beta2 rspec-mocks/spec/rspec/mocks/methods_spec.rb
opal-rspec-0.5.0.beta1 rspec-mocks/spec/rspec/mocks/methods_spec.rb