                     }
                 }
                 it("should return zero if delegate and dataSource are not set") {
+                    dataGridView.dataSource = nil
+                    dataGridView.delegate = nil
                     expect(layout.widthForColumn(0)) == 0
                 }
             }
 
             describe("heightForHeaderInSection") {
                 it("should return delegate's dataGrid:heightForRowAtIndexPath if present") {
-                    dataGridView.delegate = stubDelegate
                     expect(layout.heightForSectionHeader()) == stubDelegate.sectionHeaderHeight
                 }
 
                 it("should return it's rowHeight if delegate missing/not implements method") {
+                    dataGridView.delegate = nil
                     layout.sectionHeaderHeight = 120
                     expect(layout.heightForSectionHeader()) == 120
                 }

class DataGridViewLayoutSpec: QuickSpec {
    override func spec() {
        let frame = CGRect(x: 0, y: 0, width: 320, height: 480)
        let stubDelegate = StubDataGridViewDelegate()
        let stubDataSource = StubDataGridViewDataSource()
        var dataGridView: DataGridView!
        var layout: DataGridViewLayout!

        beforeEach {
            dataGridView = DataGridView(frame: frame)
            layout = dataGridView.layout
        }

        describe("layoutAttributesForItemAtIndexPath") {
            beforeEach {
                dataGridView.dataSource = stubDataSource
            }
            // Headers positioning
            context("layout header") {
                it("should return correct coordinates for first header") {

                    stubDelegate.rowHeight = 25
                    stubDelegate.sectionHeaderHeight = 50
                    stubDelegate.columnWidth = 100
                }

                func ensureItems(items: [Int], sections: [Int], inLayoutAttributes attributes: [UICollectionViewLayoutAttributes]) {
