Sha256: 6d3c15f85ebcbf9a1af67e0d568d8bfe0297858b23e679a1eb00815b46a75647
Contents?: true
Size: 747 Bytes
Versions: 11
Compression:
Stored size: 747 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 expect(ancestor).to 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
11 entries across 9 versions & 4 rubygems