Class: ElabsMatchers::Matchers::HaveTableRow::HaveTableRowMatcher

Inherits:
Struct
  • Object
show all
Defined in:
lib/elabs_matchers/matchers/have_table_row.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Instance Attribute Details

- (Object) page (readonly)

Returns the value of attribute page



7
8
9
# File 'lib/elabs_matchers/matchers/have_table_row.rb', line 7

def page
  @page
end

- (Object) row

Returns the value of attribute row

Returns:

  • (Object)

    the current value of row



6
7
8
# File 'lib/elabs_matchers/matchers/have_table_row.rb', line 6

def row
  @row
end

- (Object) table_name

Returns the value of attribute table_name

Returns:

  • (Object)

    the current value of table_name



6
7
8
# File 'lib/elabs_matchers/matchers/have_table_row.rb', line 6

def table_name
  @table_name
end

Instance Method Details

- (Boolean) does_not_match?(page)

Returns:

  • (Boolean)


14
15
16
17
# File 'lib/elabs_matchers/matchers/have_table_row.rb', line 14

def does_not_match?(page)
  @page = page
  !table or table.has_no_selector?(selector_type, selector)
end

- (Object) failure_message_for_should



19
20
21
# File 'lib/elabs_matchers/matchers/have_table_row.rb', line 19

def failure_message_for_should
  "Expected #{row.inspect} to be included in the table #{table_name}, but it wasn't:\n\n#{ascii_table}"
end

- (Object) failure_message_for_should_not



23
24
25
# File 'lib/elabs_matchers/matchers/have_table_row.rb', line 23

def failure_message_for_should_not
  "Expected there to be no table #{table_name} with row #{row.inspect}, but there was.\n\n#{ascii_table}"
end

- (Boolean) matches?(page)

Returns:

  • (Boolean)


9
10
11
12
# File 'lib/elabs_matchers/matchers/have_table_row.rb', line 9

def matches?(page)
  @page = page
  table and table.has_selector?(selector_type, selector)
end