Parent

Class/Module Index [+]

Quicksearch

Rex::Ui::Text::Table::UnitTest

Public Instance Methods

new_table(opts = {}) click to toggle source
# File lib/rex/ui/text/table.rb.ut.rb, line 9
def new_table(opts = {})
        if (opts['Columns'] == nil)
                opts['Columns'] =
                        [
                                'col1',
                                'col2',
                                'col3'
                        ]
        end

        tbl = Rex::Ui::Text::Table.new(opts)

        tbl << [ "r1cell1", "r1cell2", "r1cell3" ]
        tbl << [ "r2cell1", "r2cell2", "r2cell3" ]

        return tbl
end
test_basic() click to toggle source
# File lib/rex/ui/text/table.rb.ut.rb, line 27
def test_basic
        tbl = new_table

        dstr = col1     col2     col3     ----     ----     ----     r1cell1  r1cell2  r1cell3  r2cell1  r2cell2  r2cell3   

        assert_equal(tbl.to_s, dstr)
end
test_indent() click to toggle source
# File lib/rex/ui/text/table.rb.ut.rb, line 40
def test_indent
        tbl = new_table(
                'Indent' => 4)

        dstr =     col1     col2     col3         ----     ----     ----         r1cell1  r1cell2  r1cell3      r2cell1  r2cell2  r2cell3   

        assert_equal(tbl.to_s, dstr)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.