Module: Chop

Extended by:
Config, DSL
Defined in:
lib/chop.rb,
lib/chop/dsl.rb,
lib/chop/diff.rb,
lib/chop/form.rb,
lib/chop/table.rb,
lib/chop/config.rb,
lib/chop/create.rb,
lib/chop/dfn_dl.rb,
lib/chop/version.rb,
lib/chop/unordered_list.rb,
lib/chop/definition_list.rb

Defined Under Namespace

Modules: Config, DSL Classes: Create, DefinitionList, DfnDl, Diff, Form, Table, UnorderedList

Constant Summary collapse

VERSION =
"0.35.2"
Ul =
UnorderedList
Dl =
DefinitionList

Class Method Summary collapse

Methods included from DSL

create!, diff!, fill_in!

Methods included from Config

register_creation_strategy

Class Method Details

.empty_tableObject



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/chop.rb', line 16

def self.empty_table
  empty = table([[]])

  def empty.diff! other_table, **kwargs, &block
    if other_table.is_a?(String)
      begin
        other_table = Capybara.current_session.find(other_table)
      rescue Capybara::ElementNotFound
        return
      end
    end
    super other_table, **kwargs.reverse_merge(surplus_col: true, surplus_row: true), &block
  end

  empty
end

.table(raw) ⇒ Object



33
34
35
# File 'lib/chop.rb', line 33

def self.table(raw)
  Cucumber::MultilineArgument::DataTable.from(raw)
end