Module: RSpec::XlsxMatchers::Utils

Included in:
BaseSheet, Sheets
Defined in:
lib/rspec/xlsx_matchers/utils.rb

Overview

internal utilities

Instance Method Summary collapse

Instance Method Details

#force_array(value) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/rspec/xlsx_matchers/utils.rb', line 7

def force_array(value)
  if value.is_a?(Array)
    value
  else
    [value]
  end
end

#map_output(array) ⇒ Object



15
16
17
18
19
20
21
22
23
# File 'lib/rspec/xlsx_matchers/utils.rb', line 15

def map_output(array)
  array.map do |v|
    if v.is_a?(String)
      "'#{v}'"
    else
      v
    end
  end.join(", ")
end