Sha256: 200c6f8de2b6d135250e6803093db8a741db6b000297c051909b3b24e6e1f733

Contents?: true

Size: 1.28 KB

Versions: 68

Compression:

Stored size: 1.28 KB

Contents

describe "UIColor" do

  describe "modified == method" do

    it "should be intuitive" do
      :red.uicolor.should == :red.uicolor
      :blue.uicolor.should == :blue.uicolor
      :black.uicolor.should == :black.uicolor
      :white.uicolor.should == :white.uicolor
      :clear.uicolor.should == :clear.uicolor
    end

    it "should be pretty smart" do
      :red.uicolor(0.1).should == :red.uicolor(0.1)
      :blue.uicolor(0.2).should == :blue.uicolor(0.2)
      :black.uicolor(0.3).should == :black.uicolor(0.3)
      :white.uicolor(0.4).should == :white.uicolor(0.4)
      :clear.uicolor(0.5).should == :clear.uicolor(0.5)
    end

    it "should support hex codes" do
      '#59684f'.uicolor.should == '#59684f'.uicolor
      '#b87a3b'.uicolor.should == '#b87a3b'.uicolor
      '#e0214d'.uicolor.should == '#e0214d'.uicolor
      '#51504a'.uicolor.should == '#51504a'.uicolor
      '#4dc223'.uicolor(0.5).should == '#4dc223'.uicolor(0.5)
    end

    it "should support css names" do
      :blanchedalmond.uicolor.should == :blanchedalmond.uicolor
      :chartreuse.uicolor.should == :chartreuse.uicolor
      :darkgreen.uicolor.should == :darkgreen.uicolor
      :deepskyblue.uicolor.should == :deepskyblue.uicolor
      :floralwhite.uicolor(0.5).should == :floralwhite.uicolor(0.5)
    end

  end

end

Version data entries

68 entries across 68 versions & 1 rubygems

Version Path
sugarcube-3.0.4 spec/ios/uicolor_spec.rb
sugarcube-3.0.3 spec/ios/uicolor_spec.rb
sugarcube-3.0.2 spec/ios/uicolor_spec.rb
sugarcube-3.0.1 spec/ios/uicolor_spec.rb
sugarcube-3.0.0 spec/ios/uicolor_spec.rb
sugarcube-2.12.3 spec/ios/uicolor_spec.rb
sugarcube-2.12.2 spec/ios/uicolor_spec.rb
sugarcube-2.12.1 spec/ios/uicolor_spec.rb
sugarcube-2.12.0 spec/ios/uicolor_spec.rb
sugarcube-2.11.1 spec/ios/uicolor_spec.rb
sugarcube-2.11.0 spec/ios/uicolor_spec.rb
sugarcube-2.10.0 spec/ios/uicolor_spec.rb
sugarcube-2.9.1 spec/ios/uicolor_spec.rb
sugarcube-2.8.2 spec/ios/uicolor_spec.rb
sugarcube-2.8.1 spec/ios/uicolor_spec.rb
sugarcube-2.8.0 spec/ios/uicolor_spec.rb
sugarcube-2.7.1 spec/ios/uicolor_spec.rb
sugarcube-2.7.0 spec/ios/uicolor_spec.rb
sugarcube-2.6.0 spec/ios/uicolor_spec.rb
sugarcube-2.5.0 spec/ios/uicolor_spec.rb