Sha256: 186db1ce7cb3a6a4819b41495b38e483ded59e28ef92e2a69ddd0e1926a55131

Contents?: true

Size: 703 Bytes

Versions: 1

Compression:

Stored size: 703 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Relation::Operation::Set, '.included' do
  subject { object }

  let(:object) { described_class }
  let(:klass)  { Class.new       }

  it 'extends the klass' do
    klass.singleton_class.should_not include(described_class::ClassMethods)
    klass.send(:include, subject)
    klass.singleton_class.should include(described_class::ClassMethods)
  end

  it 'delegates to the ancestor' do
    included_ancestor = false
    mod = Module.new do
      define_method(:included) { |_| included_ancestor = true }
    end
    subject.extend(mod)
    expect { klass.send(:include, subject) }
      .to change { included_ancestor }.from(false).to(true)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
axiom-0.1.1 spec/unit/axiom/relation/operation/set/class_methods/included_spec.rb