Sha256: 276ff3c8dcaca037ec25f30e8038122656a542732152997810c5f17cc7e78ee4

Contents?: true

Size: 799 Bytes

Versions: 151

Compression:

Stored size: 799 Bytes

Contents

describe "UIColor component methods" do
  before do
    @black = UIColor.blackColor
    @gray = UIColor.grayColor
    @white = UIColor.whiteColor
    @some_color = UIColor.colorWithRed(0.6, green: 0.4, blue: 0.5, alpha:1.0)
  end

  it "should return 1,1,1 for white" do
    @white.red.should == 1
    @white.green.should == 1
    @white.blue.should == 1
  end

  it "should return 0,0,0 for black" do
    @black.red.should == 0
    @black.green.should == 0
    @black.blue.should == 0
  end

  it "should return 0.5,0.5,0.5 for gray" do
    @gray.red.should == 0.5
    @gray.green.should == 0.5
    @gray.blue.should == 0.5
  end

  it "should return correct rgb for some_color" do
    @some_color.red.should == 0.6
    @some_color.green.should == 0.4
    @some_color.blue.should == 0.5
  end

end

Version data entries

151 entries across 151 versions & 1 rubygems

Version Path
sugarcube-0.20.22 spec/uicolor_components_spec.rb
sugarcube-0.20.21 spec/uicolor_components_spec.rb
sugarcube-0.20.20 spec/uicolor_components_spec.rb
sugarcube-0.20.19 spec/uicolor_components_spec.rb
sugarcube-0.20.18 spec/uicolor_components_spec.rb
sugarcube-0.20.17 spec/uicolor_components_spec.rb
sugarcube-0.20.16 spec/uicolor_components_spec.rb
sugarcube-0.20.15 spec/uicolor_components_spec.rb
sugarcube-0.20.13 spec/uicolor_components_spec.rb
sugarcube-0.20.12 spec/uicolor_components_spec.rb
sugarcube-0.20.11 spec/uicolor_components_spec.rb
sugarcube-0.20.10 spec/uicolor_components_spec.rb
sugarcube-0.20.9 spec/uicolor_components_spec.rb
sugarcube-0.20.8 spec/uicolor_components_spec.rb
sugarcube-0.20.7 spec/uicolor_components_spec.rb
sugarcube-0.20.6 spec/uicolor_components_spec.rb
sugarcube-0.20.5 spec/uicolor_components_spec.rb
sugarcube-0.20.4 spec/uicolor_components_spec.rb
sugarcube-0.20.3 spec/uicolor_components_spec.rb
sugarcube-0.20.1 spec/uicolor_components_spec.rb