Class: TableComparer

Inherits:
Object
  • Object
show all
Includes:
Capybara::DSL
Defined in:
lib/test_services/cucumber/table_comparer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cucumber_table, selector) ⇒ TableComparer

Returns a new instance of TableComparer.



5
6
7
8
# File 'lib/test_services/cucumber/table_comparer.rb', line 5

def initialize(cucumber_table, selector)
  @cucumber_table = cucumber_table
  @selector = selector
end

Instance Attribute Details

#cucumber_tableObject

Returns the value of attribute cucumber_table.



3
4
5
# File 'lib/test_services/cucumber/table_comparer.rb', line 3

def cucumber_table
  @cucumber_table
end

#selectorObject

Returns the value of attribute selector.



3
4
5
# File 'lib/test_services/cucumber/table_comparer.rb', line 3

def selector
  @selector
end

Instance Method Details

#matches?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/test_services/cucumber/table_comparer.rb', line 10

def matches?
  cucumber_table.diff!(table_to_2d_array).nil?
end