Sha256: 08a1345f24dab88edb15d93f58071feac8423a5243661d917e9071d08bd0dfa0
Contents?: true
Size: 1.22 KB
Versions: 3
Compression:
Stored size: 1.22 KB
Contents
require "active_support/inflector" module Chop module DSL extend self def create! klass, table, &block Create.create! klass, table, &block end def diff! selector, table, session: Capybara.current_session, as: nil, timeout: nil, &block class_name = if as as.to_s elsif selector.respond_to?(:tag_name) selector.tag_name else session.find(selector).tag_name end.camelize klass = const_get("Chop::#{class_name}") kwargs = { session: session } kwargs[:timeout] = timeout if timeout.present? klass.diff! selector, table, **kwargs, &block end def fill_in! table Form.fill_in! table end end if defined?(Cucumber::MultilineArgument::DataTable) Cucumber::MultilineArgument::DataTable.prepend Module.new { def create! klass, &block DSL.create! klass, self, &block end def diff! other_table="table", **kwargs, &block if other_table.respond_to?(:tag_name) || (other_table.is_a?(String) && !other_table.include?("|")) DSL.diff! other_table, self, **kwargs, &block else super end end def fill_in! DSL.fill_in! self end } end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
chop-0.29.0 | lib/chop/dsl.rb |
chop-0.28.1 | lib/chop/dsl.rb |
chop-0.28.0 | lib/chop/dsl.rb |