Sha256: 614c482d1dcdf2a76ad9330e72aaaf09bfe9d0529977ff6dbe8a0f600d7f034a

Contents?: true

Size: 1.01 KB

Versions: 16

Compression:

Stored size: 1.01 KB

Contents

require 'tc_helper.rb'

class TestBreak < Test::Unit::TestCase

  def setup
    @break = Axlsx::Break.new(:id => 1, :min => 1, :max => 10, :man => true, :pt => false)
  end

  def test_id
    assert_equal(1, @break.id)
    assert_raises ArgumentError do
      Axlsx::Break.new(:hoge, {:id => -1})
    end
  end

  def test_min
    assert_equal(1, @break.min)
    assert_raises ArgumentError do
      Axlsx::Break.new(:hoge, :min => -1)
    end
  end

  def test_max
    assert_equal(10, @break.max)
    assert_raises ArgumentError do
      Axlsx::Break.new(:hoge, :max => -1)
    end
  end


  def test_man
    assert_equal(true, @break.man)
    assert_raises ArgumentError do
      Axlsx::Break.new(:man => -1)
    end
  end

  def test_pt
    assert_equal(false, @break.pt)
    assert_raises ArgumentError do
      Axlsx::Break.new(:pt => -1)
    end
  end

  def test_to_xml_string
    doc = Nokogiri::XML(@break.to_xml_string)
    assert_equal(doc.xpath('//brk[@id="1"][@min="1"][@max="10"][@pt=0][@man=1]').size, 1)
  end
end

Version data entries

16 entries across 16 versions & 6 rubygems

Version Path
caxlsx-3.1.1 test/workbook/worksheet/tc_break.rb
caxlsx-3.1.0 test/workbook/worksheet/tc_break.rb
bonio-axlsx-2.2.3 test/workbook/worksheet/tc_break.rb
caxlsx-3.0.4 test/workbook/worksheet/tc_break.rb
caxlsx-3.0.3 test/workbook/worksheet/tc_break.rb
caxlsx-3.0.2 test/workbook/worksheet/tc_break.rb
caxlsx-3.0.1 test/workbook/worksheet/tc_break.rb
caxlsx-3.0.0 test/workbook/worksheet/tc_break.rb
axlsx-alt-3.0.1 test/workbook/worksheet/tc_break.rb
axlsx-alt-3.0.0 test/workbook/worksheet/tc_break.rb
axlsx-3.0.0.pre test/workbook/worksheet/tc_break.rb
bonio-axlsx-2.2.2 test/workbook/worksheet/tc_break.rb
bonio-axlsx-2.2.1 test/workbook/worksheet/tc_break.rb
dg-axlsx-2.1.0 test/workbook/worksheet/tc_break.rb
axlsx-2.1.0.pre test/workbook/worksheet/tc_break.rb
l_axlsx-2.0.1 test/workbook/worksheet/tc_break.rb