test/element/worksheet_test.rb in xmlss-0.4.1 vs test/element/worksheet_test.rb in xmlss-1.0.0.rc.1

- old
+ new

@@ -6,12 +6,17 @@ class WorksheetTest < Assert::Context desc "Xmlss::Worksheet" before { @wksht = Worksheet.new('sheet') } subject { @wksht } + should have_class_method :writer should have_accessor :name + should "know its writer hook" do + assert_equal :worksheet, subject.class.writer + end + should "set it's defaults" do assert_equal 'sheet', subject.name end should "filter name chars" do @@ -27,15 +32,15 @@ assert_equal "te]st test", ws.name ws.name = "t[e]st test" assert_equal "t[e]st test", ws.name end - should "bark when no name is given" do + should "complain if given a name longer than 31 chars" do assert_raises ArgumentError do - Worksheet.new(nil) + Worksheet.new('a'*32) end - assert_raises ArgumentError do - Worksheet.new("") + assert_nothing_raised do + Worksheet.new('a'*31) end end end