Sha256: 73fd50c66f67d870f153f43b094c4afb67dc3b0bdd0e685df9c5b0f83a08b307

Contents?: true

Size: 651 Bytes

Versions: 1

Compression:

Stored size: 651 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Memoizable::ModuleMethods, '#included' do
  subject { descendant.instance_exec(object) { |mod| include mod } }

  let(:object)     { Module.new.extend(described_class) }
  let(:descendant) { Class.new                          }
  let(:superclass) { Module                             }

  before do
    # Prevent Module.included from being called through inheritance
    allow(Memoizable).to receive(:included)
  end

  it_behaves_like 'it calls super', :included

  it 'includes Memoizable into the descendant' do
    subject
    expect(descendant.included_modules).to include(Memoizable)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
memoizable-0.4.2 spec/unit/memoizable/module_methods/included_spec.rb