Sha256: 2ce69f21d347760f0aa354a648a2701075bd77b5948eb6c40f1b969badc60f41

Contents?: true

Size: 638 Bytes

Versions: 4

Compression:

Stored size: 638 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
    Memoizable.stub(: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

4 entries across 4 versions & 1 rubygems

Version Path
memoizable-0.4.1 spec/unit/memoizable/module_methods/included_spec.rb
memoizable-0.4.0 spec/unit/memoizable/module_methods/included_spec.rb
memoizable-0.3.1 spec/unit/memoizable/module_methods/included_spec.rb
memoizable-0.3.0 spec/unit/memoizable/module_methods/included_spec.rb