Class: RSpec::XlsxMatchers::FilledRows
- Defined in:
- lib/rspec/xlsx_matchers/filled_rows.rb
Overview
filled rows count matcher
Instance Attribute Summary collapse
-
#expected_filled_row_count ⇒ Object
readonly
Returns the value of attribute expected_filled_row_count.
Attributes inherited from BaseSheet
Instance Method Summary collapse
- #failure_message ⇒ Object
- #failure_message_when_negated ⇒ Object
-
#initialize(count) ⇒ FilledRows
constructor
A new instance of FilledRows.
- #matches?(subject) ⇒ Boolean
Methods inherited from BaseSheet
Methods included from Utils
Constructor Details
#initialize(count) ⇒ FilledRows
Returns a new instance of FilledRows.
9 10 11 12 |
# File 'lib/rspec/xlsx_matchers/filled_rows.rb', line 9 def initialize(count) super() @expected_filled_row_count = count end |
Instance Attribute Details
#expected_filled_row_count ⇒ Object (readonly)
Returns the value of attribute expected_filled_row_count.
7 8 9 |
# File 'lib/rspec/xlsx_matchers/filled_rows.rb', line 7 def expected_filled_row_count @expected_filled_row_count end |
Instance Method Details
#failure_message ⇒ Object
22 23 24 25 26 |
# File 'lib/rspec/xlsx_matchers/filled_rows.rb', line 22 def return if sheet.nil? "Expected #{expected_filled_row_count} filled rows but found #{actual_filled_row_count}" end |
#failure_message_when_negated ⇒ Object
28 29 30 31 32 |
# File 'lib/rspec/xlsx_matchers/filled_rows.rb', line 28 def return if sheet.nil? "Expected NOT to find #{expected_filled_row_count} filled rows but did" end |
#matches?(subject) ⇒ Boolean
14 15 16 17 18 19 20 |
# File 'lib/rspec/xlsx_matchers/filled_rows.rb', line 14 def matches?(subject) @subject = subject @sheet = find_sheet return false if sheet.nil? actual_filled_row_count == expected_filled_row_count end |