test/cell_test.rb in osheet-0.9.0 vs test/cell_test.rb in osheet-0.9.1

- old
+ new

@@ -19,10 +19,11 @@ assert_kind_of Format::General, subject.send(:get_ivar, "format") assert_equal 1, subject.send(:get_ivar, "colspan") assert_equal 1, subject.send(:get_ivar, "rowspan") assert_equal nil, subject.send(:get_ivar, "href") assert_equal nil, subject.send(:get_ivar, "index") + assert_equal nil, subject.send(:get_ivar, "formuala") end should "type cast data strings/symbols" do ['a string', :symbol].each do |thing| cell = Cell.new{data thing} @@ -59,20 +60,22 @@ data "Poo" format :number colspan 4 rowspan 2 index 3 + formula "=R1C1" href "http://www.google.com" end end should "should set them correctly" do assert_equal "Poo", subject.send(:get_ivar, "data") assert_kind_of Format::Number, subject.send(:get_ivar, "format") - assert_equal 4, subject.send(:get_ivar, "colspan") - assert_equal 2, subject.send(:get_ivar, "rowspan") - assert_equal 3, subject.send(:get_ivar, "index") + assert_equal 4, subject.send(:get_ivar, "colspan") + assert_equal 2, subject.send(:get_ivar, "rowspan") + assert_equal 3, subject.send(:get_ivar, "index") + assert_equal "=R1C1", subject.send(:get_ivar, "formula") assert_equal "http://www.google.com", subject.send(:get_ivar, "href") end should "know it's attribute(s)" do [:style_class, :data, :format, :rowspan, :colspan, :index, :href].each do |a| @@ -83,9 +86,10 @@ assert_equal "Poo", subject.attributes[:data] assert_kind_of Format::Number, subject.attributes[:format] assert_equal 4, subject.attributes[:colspan] assert_equal 2, subject.attributes[:rowspan] assert_equal 3, subject.attributes[:index] + assert_equal "=R1C1", subject.attributes[:formula] assert_equal "http://www.google.com", subject.attributes[:href] end end