Sha256: 9901a5c66d8ea767e52e982b9ef3b4a6b8e0a7833018042069a4a4292c7168a6
Contents?: true
Size: 705 Bytes
Versions: 1
Compression:
Stored size: 705 Bytes
Contents
# encoding: utf-8 require 'spec_helper' describe Relation::Operation::Binary, '.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/binary/class_methods/included_spec.rb |