Sha256: 0cd052abdf7fde7a48a9d54422222d93cc674c1824d978b1c0184a748d0ed42f

Contents?: true

Size: 797 Bytes

Versions: 2

Compression:

Stored size: 797 Bytes

Contents

describe Joybox::Core::Color do
  describe "Initialization" do
    it "should initialize with options" do
      color = Color.create red:39, green:40, blue:34
      color.red.should == 39
      color.green.should == 40
      color.blue.should == 34
    end

    it "should initialize with rgb" do
      color = Color.from_rgb(39, 40, 34)
      color.red.should == 39
      color.green.should == 40
      color.blue.should == 34
    end

    it "should initialize with hex" do
      color = Color.from_hex('#272822')
      color.red.should == 39
      color.green.should == 40
      color.blue.should == 34
    end

    it "should initialize from string" do
      color = '#272822'.to_color
      color.red.should == 39
      color.green.should == 40
      color.blue.should == 34
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
joybox-1.1.1 spec/motion/joybox/common/color_spec.rb
joybox-1.1.0 spec/motion/joybox/common/color_spec.rb