Sha256: 1a1374dcf9c776d502f209b738a15fd71b42534df6f506e85047f15172e26284
Contents?: true
Size: 698 Bytes
Versions: 1
Compression:
Stored size: 698 Bytes
Contents
# encoding: utf-8 require 'spec_helper' describe Function::Comparable, '.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/function/comparable/class_methods/included_spec.rb |