Grid is all working except for subviews

This commit is contained in:
Todd Werth
2014-05-27 18:41:57 -07:00
parent ce4c0302ad
commit 2d4f801dfe
4 changed files with 90 additions and 30 deletions

View File

@@ -1,9 +1,6 @@
describe 'grid' do
before do
#@vc = UIViewController.alloc.init
#@viewq = @vc.rmq.append(UIView)
@grid = RubyMotionQuery::Grid.new({
num_columns: 10,
column_gutter: 8,
@@ -91,6 +88,15 @@ describe 'grid' do
@grid[':a'].should == {r: 7 + @grid.column_width}
end
should 'work with a:a' do
@grid['a:a'].should == {l: @grid.content_left_margin, r: @grid.content_left_margin + @grid.column_width}
end
should 'work with a:b' do
r = @grid.content_left_margin + @grid.column_width + @grid.column_gutter + @grid.column_width
@grid['a:b'].should == {l: @grid.content_left_margin, r: r}
end
should 'return 2 member hash when specifying only column:number' do
@grid['a:1'].should == {l: 7, b: 221.799987792969}
@grid['b:0'].should == {l: 7 + @grid.column_width + 8, b: 5 + @grid.row_height}