Permalink
Browse files

Add the default values for Slot width/height styles. This is a test s…

…nippet:

Shoes.app do
  path = 'static/shoes-icon.png'
  stack do
    image path
    flow do
      2.times{image path}
    end
    image path
  end
end
  • Loading branch information...
1 parent 50acce0 commit 87ce855b66a95c5eb593a3f4634bf67d9687cc69 @ashbb ashbb committed Aug 10, 2012
Showing with 9 additions and 0 deletions.
  1. +2 −0 lib/shoes/slot.rb
  2. +7 −0 spec/shoes/flow_spec.rb
View
@@ -15,6 +15,8 @@ def initialize parent, opts={}, &blk
instance_variable_set "@#{v}", opts[v.to_sym]
end
+ @width ||= 1.0
+ @height ||= 0
@blk = blk
@gui = Shoes.configuration.backend_for(self, @parent.gui)
View
@@ -32,4 +32,11 @@
subject.blk.should == input_block
end
end
+
+ it "should set default values" do
+ parent.stub(:gui)
+ f = Shoes::Flow.new(parent)
+ f.width.should == 1.0
+ f.height.should == 0
+ end
end

0 comments on commit 87ce855

Please sign in to comment.