Sha256: 27219f12b7a659dbe4290699f3dda48b3eab6429017d620f8532e19bd6e61f8e
Contents?: true
Size: 813 Bytes
Versions: 13
Compression:
Stored size: 813 Bytes
Contents
# encoding: utf-8 # RSpec.shared_examples 'Specialized Class Finder' do let(:builder) { Formtastic::FormBuilder.allocate } subject(:finder) { described_class.new(builder) } context 'by default' do it 'includes Object and the default namespaces' do expect(finder.namespaces).to eq([Object, default]) end end context 'with namespace configuration set to a custom list of modules' do before do stub_const('CustomModule', Module.new) stub_const('AnotherModule', Module.new) allow(Formtastic::FormBuilder).to receive(namespaces_setting) .and_return([ CustomModule, AnotherModule ]) end it 'includes just the custom namespaces' do expect(finder.namespaces).to eq([CustomModule, AnotherModule]) end end end
Version data entries
13 entries across 13 versions & 3 rubygems