Sha256: 8a3d04ffab926e1c981dde4d07da34b6fde34b173485e7dea1b3fbf6ecab1532

Contents?: true

Size: 1.39 KB

Versions: 151

Compression:

Stored size: 1.39 KB

Contents

describe "UIImage#color_at" do
  before do
    @image = 'little_square'.uiimage
  end

  describe "should return white at the corners" do
    it "top_left" do
      color = @image.color_at([0, 0])
      color.red.should == 1
      color.green.should == 1
      color.blue.should == 1
    end
    it "top_right" do
      color = @image.color_at([9, 0])
      color.red.should == 1
      color.green.should == 1
      color.blue.should == 1
    end
    it "bottom_left" do
      color = @image.color_at([0, 9])
      color.red.should == 1
      color.green.should == 1
      color.blue.should == 1
    end
    it "bottom_right" do
      color = @image.color_at([9, 9])
      color.red.should == 1
      color.green.should == 1
      color.blue.should == 1
    end
  end

  describe "should return blue at the center" do
    it "3,3" do
      color = @image.color_at([3, 3])
      color.red.should == 0
      color.green.should == 0
      color.blue.should == 1
    end
    it "4,4" do
      color = @image.color_at([4, 4])
      color.red.should == 0
      color.green.should == 0
      color.blue.should == 1
    end
    it "5,5" do
      color = @image.color_at([5, 5])
      color.red.should == 0
      color.green.should == 0
      color.blue.should == 1
    end
    it "6,6" do
      color = @image.color_at([6, 6])
      color.red.should == 0
      color.green.should == 0
      color.blue.should == 1
    end
  end
end

Version data entries

151 entries across 151 versions & 1 rubygems

Version Path
sugarcube-0.18.3 spec/uiimage_color_at_spec.rb
sugarcube-0.18.2 spec/uiimage_color_at_spec.rb
sugarcube-0.18.1 spec/uiimage_color_at_spec.rb
sugarcube-0.18.0 spec/uiimage_color_at_spec.rb
sugarcube-0.16.9 spec/uiimage_color_at_spec.rb
sugarcube-0.16.5 spec/uiimage_color_at_spec.rb
sugarcube-0.16.2 spec/uiimage_color_at_spec.rb
sugarcube-0.16 spec/uiimage_color_at_spec.rb
sugarcube-0.15.5 spec/uiimage_color_at_spec.rb
sugarcube-0.15.3 spec/uiimage_color_at_spec.rb
sugarcube-0.15.0 spec/uiimage_color_at_spec.rb