Sha256: f6dcffc27e3a4192a353bb0a6b589172bf976963438b48df493cb3072193d451
Contents?: true
Size: 743 Bytes
Versions: 4
Compression:
Stored size: 743 Bytes
Contents
# encoding: utf-8 require 'spec_helper' describe Axiom::Types::Options, '#inherited' do subject { descendant } let(:object) do Class.new(ancestor) do extend Options, DescendantsTracker accept_options :primitive, :coerce_method primitive ::String end end let(:ancestor) do Class.new end let(:descendant) do Class.new(object) end it 'delegates to the ancestor' do ancestor.should_receive(:inherited).twice subject end it 'adds the accepted option to the descendant' do subject expect(descendant).to respond_to(:primitive, :coerce_method) end it 'sets the default value for the descendant' do subject expect(descendant.primitive).to be(::String) end end
Version data entries
4 entries across 4 versions & 1 rubygems