Module: Remi::DataSource::DataStub
- Included in:
- CsvFile, DataFrame, Postgres, Salesforce
- Defined in:
- lib/remi/cucumber/data_source.rb
Instance Method Summary collapse
Instance Method Details
#empty_stub_df ⇒ Object
17 18 19 |
# File 'lib/remi/cucumber/data_source.rb', line 17 def empty_stub_df self.df = Daru::DataFrame.new([], order: @fields.keys) end |
#stub_df ⇒ Object
21 22 23 24 |
# File 'lib/remi/cucumber/data_source.rb', line 21 def stub_df empty_stub_df self.df.add_row(stub_row_array) end |
#stub_row_array ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/remi/cucumber/data_source.rb', line 4 def stub_row_array @fields.values.map do |attrib| case attrib[:type] when :date stub_values[:date].strftime(attrib[:format]) when nil stub_values[:string] else stub_values[attrib[:type]] end end end |
#stub_values ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/remi/cucumber/data_source.rb', line 26 def stub_values @stub_values ||= { string: "Some String", number: 133, float: 3.14159, integer: 38, date: Date.parse('2015-10-21') } end |