spec/lib/base_spec.rb in wrap_it-0.1.4 vs spec/lib/base_spec.rb in wrap_it-0.1.5
- old
+ new
@@ -12,13 +12,20 @@
it 'gets tag name from options' do
expect(successor(tag: 'p').tag).to eq 'p'
end
- it 'extends @arguments with ArgumentsArray module' do
+ it 'drops @arguments after init' do
expect(
successor.instance_variable_get(:@arguments)
- ).to be_kind_of WrapIt::ArgumentsArray
+ ).to be_nil
+ end
+
+ it 'extends @arguments with ArgumentsArray module' do
+ args = nil
+ successor_class.class_eval { after_initialize { args = @arguments } }
+ successor
+ expect(args).to be_kind_of WrapIt::ArgumentsArray
end
it 'symbolizes options hash' do
successor.send :options=, 'my' => 'value'
expect(successor.options).to eq(my: 'value', class: [])