mirror of
https://github.com/zhigang1992/rmq.git
synced 2026-04-30 21:52:33 +08:00
Grid is all working except for subviews
This commit is contained in:
12
spec/grid.rb
12
spec/grid.rb
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user