[ANN] Ruby Reports 0.8.1, cleanup and bug fixes

0 views
Skip to first unread message

Gregory Brown

unread,
Feb 8, 2007, 11:18:35 AM2/8/07
to Ruby Reports
== Changes

- Fixed a bug in Table#<< which effected subtables and grouping for
tables without column names (tests inlined below)

- now depends on RedCloth 3.0.3 or higher rather than 3.0.4

- no longer carries a bunch of junk files. (i hope)

== Note

If you are using 0.8.0 please update, these bugs will probably bite
you otherwise.

== Coverage for bugs. The source was Table#<< but the tests burrow downward.

test_groupable.rb:

#Ticket #155
def test_ensure_grouping_works_with_nameless_tables
a = [[1,2],[3,4],[5,6]].to_table
a.create_group("foo") { true }
a[1].tag("grp_bar")
assert_nothing_raised { a.groups }
assert_equal a, a.group("foo")
assert_equal [a[1]].to_table, a.group("bar")
end


test_table.rb:

def test_ensure_subtable_works_with_unnamed_tables
a = [[1,2,3],[4,5,6]].to_table
b = a.sub_table { |r| (r[0] % 2).zero? }
assert_equal [[4,5,6]].to_table, b
end

def test_ensure_appending_records_works_with_unnamed_tables
a = [[1,2,3],[4,5,6]].to_table
a << Ruport::Data::Record.new([7,8,9])
assert_equal [[1,2,3],[4,5,6],[7,8,9]].to_table,a
end

Reply all
Reply to author
Forward
0 new messages