spec/view/view_basics_spec.rb in garterbelt-0.0.4 vs spec/view/view_basics_spec.rb in garterbelt-0.0.5
- old
+ new
@@ -11,16 +11,10 @@
before do
@view = BasicView.new
end
- describe 'pooling' do
- it 'includes the swimsuit' do
- BasicView.ancestors.should include( RuPol::Swimsuit )
- end
- end
-
describe 'attributes' do
it 'has a tag buffer' do
@view.buffer.should == []
@tag = Garterbelt::ContentTag.new(:view => @view, :type => :hr)
@view.buffer << @tag
@@ -55,9 +49,21 @@
end
it 'can be set via initialization' do
BasicView.new(:level => 42).level.should == 42
end
+ end
+
+ it 'can be initailzed with a block' do
+ view = BasicView.new do
+ Garterbelt::Tag.new(:type => :p, :content => 'Initalization block content', :view => view)
+ end
+ view.block.is_a?(Proc).should be_true
+ end
+
+ it 'can save the options' do
+ view = BasicView.new(:foo => 'foo', :bar => 'bar')
+ view.options.should == {:foo => 'foo', :bar => 'bar'}
end
describe 'setting the curator: view responsible for displaying the rendered content' do
before do
@view.level = 42