lib/chop/dsl.rb in chop-0.20.1 vs lib/chop/dsl.rb in chop-0.21.0
- old
+ new
@@ -2,12 +2,12 @@
module DSL
def create! klass, table, &block
Create.create! klass, table, &block
end
- def diff! selector, table, session: Capybara.current_session, &block
- class_name = session.find(selector).tag_name.capitalize
+ def diff! selector, table, session: Capybara.current_session, as: nil, &block
+ class_name = as ? as.to_s.camelize : session.find(selector).tag_name.camelize
klass = const_get("Chop::#{class_name}")
klass.diff! selector, table, session: session, &block
end
def fill_in! table
@@ -22,10 +22,10 @@
Chop.create! klass, self, &block
end
def diff! other_table="table", options={}, &block
if other_table.is_a?(String) && !other_table.include?("|")
- Chop.diff! other_table, self, &block
+ Chop.diff! other_table, self, options, &block
else
super
end
end