test/workbook_test.rb in osheet-1.0.0.rc.3 vs test/workbook_test.rb in osheet-1.0.0.rc.4
- old
+ new
@@ -159,11 +159,11 @@
worksheet {
name "one"
}
worksheet {
name "two"
- meta :some_meta
+ meta :val => 'some meta', :wksht_name => self.name
}
}
end
should "return the worksheet obj created" do
@@ -172,11 +172,11 @@
should "add them to it's worksheets reader" do
assert_equal 2, subject.worksheets.size
assert_equal "one", subject.worksheets.first.name
assert_equal "two", subject.worksheets.last.name
- assert_equal :some_meta, subject.worksheets.last.meta
+ assert_equal({:val => 'some meta', :wksht_name => 'two'}, subject.worksheets.last.meta)
end
should "return the last worksheet added if called with no args" do
assert_equal subject.worksheets.last, subject.worksheet
end
@@ -200,15 +200,17 @@
cell(column.meta[:label])
end
}
row(120) {
cell {
- data 12234
+ style_class 'too awesome'
+ data self.style_class.to_s
format :currency
}
cell(Time.now) {
format :datetime, 'mm/dd/yyyy'
+ data self.format.key
}
}
}
}
@@ -230,13 +232,14 @@
assert_equal subject.rows.first, subject.writer.rows.last
end
should "access the cells of its last row" do
assert_equal 2, subject.cells.size
- assert_equal 12234, subject.cells.first.data
+ assert_equal 'too awesome', subject.cells.first.data
+ assert_equal 'datetime_mm/dd/yyyy', subject.cells.last.data
- assert_equal 4, subject.writer.cells.size
assert_equal subject.cells.last, subject.writer.rows.last.cells.last
+ assert_equal 4, subject.writer.cells.size
end
end
class WorkbookPartialTests < WorkbookTests