Sha256: 0c4e0fac8a2da0634791f7f3e0565996fa46323435eeaf42ff4465af6085d733

Contents?: true

Size: 679 Bytes

Versions: 38

Compression:

Stored size: 679 Bytes

Contents

require 'tc_helper.rb'

class TestGradientStop < Test::Unit::TestCase

  def setup
    @item = Axlsx::GradientStop.new(Axlsx::Color.new(:rgb=>"FFFF0000"), 1.0)
  end

  def teardown
  end


  def test_initialiation
    assert_equal(@item.color.rgb, "FFFF0000")
    assert_equal(@item.position, 1.0)
  end

  def test_position
    assert_raise(ArgumentError) { @item.position = -1.1 }
    assert_nothing_raised { @item.position = 0.0 }
    assert_equal(@item.position, 0.0)
  end

  def test_color
    assert_raise(ArgumentError) { @item.color = nil }
    color = Axlsx::Color.new(:rgb=>"FF0000FF")
    @item.color = color
    assert_equal(@item.color.rgb, "FF0000FF")
  end

end

Version data entries

38 entries across 38 versions & 6 rubygems

Version Path
caxlsx-3.1.1 test/stylesheet/tc_gradient_stop.rb
caxlsx-3.1.0 test/stylesheet/tc_gradient_stop.rb
bonio-axlsx-2.2.3 test/stylesheet/tc_gradient_stop.rb
caxlsx-3.0.4 test/stylesheet/tc_gradient_stop.rb
caxlsx-3.0.3 test/stylesheet/tc_gradient_stop.rb
caxlsx-3.0.2 test/stylesheet/tc_gradient_stop.rb
caxlsx-2.0.2 test/stylesheet/tc_gradient_stop.rb
caxlsx-3.0.1 test/stylesheet/tc_gradient_stop.rb
caxlsx-3.0.0 test/stylesheet/tc_gradient_stop.rb
axlsx-alt-3.0.1 test/stylesheet/tc_gradient_stop.rb
axlsx-alt-3.0.0 test/stylesheet/tc_gradient_stop.rb
axlsx-3.0.0.pre test/stylesheet/tc_gradient_stop.rb
bonio-axlsx-2.2.2 test/stylesheet/tc_gradient_stop.rb
bonio-axlsx-2.2.1 test/stylesheet/tc_gradient_stop.rb
dg-axlsx-2.1.0 test/stylesheet/tc_gradient_stop.rb
axlsx-2.1.0.pre test/stylesheet/tc_gradient_stop.rb
l_axlsx-2.0.1 test/stylesheet/tc_gradient_stop.rb
axlsx-2.0.1 test/stylesheet/tc_gradient_stop.rb
axlsx-2.0.0 test/stylesheet/tc_gradient_stop.rb
axlsx-1.3.6 test/stylesheet/tc_gradient_stop.rb