Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

22 lines (15 sloc) 0.625 kb
require 'spec_helper'
describe Virtus::ClassMethods, '#inherited' do
subject { Class.new(object) }
let(:object) { Class.new { extend Virtus::ClassMethods } }
it 'includes an AttributeSet module' do
descendant = subject
# return the descendant's attribute accessor modules (superclass + own)
modules = descendant.ancestors.grep(Virtus::AttributeSet)
modules.size.should be(2)
# remove the superclass' attribute accessor module
modules -= object.ancestors.grep(Virtus::AttributeSet)
# the descendant should have it's own attribute accessor module
modules.size.should be(1)
end
end
Jump to Line
Something went wrong with that request. Please try again.