Class: RSpec::XlsxMatchers::CellValue
- Defined in:
- lib/rspec/xlsx_matchers/cell_value.rb
Overview
have_excel_cell_value
Instance Attribute Summary collapse
-
#actual_value ⇒ Object
readonly
Returns the value of attribute actual_value.
-
#expected_value ⇒ Object
readonly
Returns the value of attribute expected_value.
Attributes included from InColumn
Attributes included from InRow
Attributes inherited from BaseSheet
Instance Method Summary collapse
- #failure_message ⇒ Object
- #failure_message_in_column ⇒ Object
-
#initialize(expected_value) ⇒ CellValue
constructor
A new instance of CellValue.
Methods included from InColumn
#in_column, #in_column_by_index
Methods included from InRow
Methods inherited from BaseSheet
Methods included from Utils
Constructor Details
#initialize(expected_value) ⇒ CellValue
Returns a new instance of CellValue.
11 12 13 14 |
# File 'lib/rspec/xlsx_matchers/cell_value.rb', line 11 def initialize(expected_value) super() @expected_value = expected_value end |
Instance Attribute Details
#actual_value ⇒ Object (readonly)
Returns the value of attribute actual_value.
9 10 11 |
# File 'lib/rspec/xlsx_matchers/cell_value.rb', line 9 def actual_value @actual_value end |
#expected_value ⇒ Object (readonly)
Returns the value of attribute expected_value.
9 10 11 |
# File 'lib/rspec/xlsx_matchers/cell_value.rb', line 9 def expected_value @expected_value end |
Instance Method Details
#failure_message ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/rspec/xlsx_matchers/cell_value.rb', line 16 def return if sheet.nil? return if header_column_not_found? return if row_not_found? return if column_not_found? "Mismatch cell value in column #{} of row '#{row_index}': " \ "expected: '#{expected_value}', received: '#{actual_value}'" end |
#failure_message_in_column ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/rspec/xlsx_matchers/cell_value.rb', line 26 def if column_name.nil? "column with index #{column_index}" else "column '#{column_name}'" end end |