         
         view.layoutSubviews()
         
-        expect(view.subviews[1].backgroundColor).to(equal(UIColor.yellow))
+        let backgroundView = view.subviews[backgroundViewIndex]
+        expect(backgroundView.backgroundColor).to(equal(UIColor.yellow))
     }
     
     func testShouldAllowSettingProgressBarFillColor() {

    
    func testLayoutSubviews_shouldRenderBackgroundViewWithRoundedCorners() {
        let view = setupView(frame: CGRect(x: 0, y: 0, width: 100, height: 10))
        let backgroundView = view.subviews[1]
        
        let expectedRoundedCorners: CGFloat = 3.5
        expect(backgroundView.layer.cornerRadius).to(beCloseTo(expectedRoundedCorners, within: 0.01))

import GTProgressBar

class GTProgressBarTests: XCTestCase {
    private let backgroundViewIndex = 1
    private let fillViewIndex = 2
    
    func testInitWithFrame_shouldCreateAllSubviews() {
        let view = GTProgressBar(frame: CGRect.zero)
