class Wrapybara::TableBody

Attributes

element[R]
parent[R]

Public Class Methods

new(table) click to toggle source
# File lib/wrapybara/elements/table_body.rb, line 7
def initialize(table)
        @parent = table
        @element = table.element.find('tbody') rescue nil
end

Public Instance Methods

cell(*args) click to toggle source
# File lib/wrapybara/elements/table_body.rb, line 20
def cell(*args)
        TableCell.new(self, args)
end
exists?() click to toggle source
# File lib/wrapybara/elements/table_body.rb, line 36
def exists?
        !@element.nil?
end
should_exist() click to toggle source
Calls superclass method Wrapybara::Element#should_exist
# File lib/wrapybara/elements/table_body.rb, line 12
def should_exist
      super "Expected table #{@parent.how} '#{self.parent_identifier} to have a body"
end
should_have_cells(labels) click to toggle source
# File lib/wrapybara/elements/table_body.rb, line 24
def should_have_cells(labels)
        labels.each do |label|
                self.cell(label).should_exist
        end
end
should_not_exist() click to toggle source
Calls superclass method Wrapybara::Element#should_not_exist
# File lib/wrapybara/elements/table_body.rb, line 16
def should_not_exist
        super "Did not expect table #{@parent.how} '#{self.parent_identifier} to have a body"
end
should_not_have_cells(labels) click to toggle source
# File lib/wrapybara/elements/table_body.rb, line 30
def should_not_have_cells(labels)
        labels.each do |label|
                self.cell(label).should_not_exist
        end
end