Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 87ce855b66a95c5eb593a3f4634bf67d9687cc69 1 parent 50acce0
@ashbb ashbb authored
Showing with 9 additions and 0 deletions.
  1. +2 −0  lib/shoes/slot.rb
  2. +7 −0 spec/shoes/flow_spec.rb
View
2  lib/shoes/slot.rb
@@ -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
7 spec/shoes/flow_spec.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.