Sha256: 0fbd2d0f84fe761bbb67a98fa29d1ac1cc44a8219de345d1521722c97bf8c403

Contents?: true

Size: 584 Bytes

Versions: 5

Compression:

Stored size: 584 Bytes

Contents

require_relative '../../spec_helper'
require_relative '../../../lib/reek/context/singleton_method_context'
require_relative '../../../lib/reek/context/root_context'

RSpec.describe Reek::Context::SingletonMethodContext do
  let(:smc) do
    sexp = s(:def, :foo, s(:args, s(:arg, :bar)), nil)
    Reek::Context::SingletonMethodContext.new(Reek::Context::RootContext.new, sexp)
  end

  describe '#envious_receivers' do
    it 'should not record envious calls' do
      smc.record_call_to s(:send, s(:lvar, :bar), :baz)
      expect(smc.envious_receivers).to be_empty
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
reek-3.0.4 spec/reek/context/singleton_method_context_spec.rb
reek-3.0.3 spec/reek/context/singleton_method_context_spec.rb
reek-3.0.2 spec/reek/context/singleton_method_context_spec.rb
reek-3.0.1 spec/reek/context/singleton_method_context_spec.rb
reek-3.0.0 spec/reek/context/singleton_method_context_spec.rb