lib/page-object/accessors.rb in page-object-0.8 vs lib/page-object/accessors.rb in page-object-0.8.1
- old
+ new
@@ -2036,12 +2036,12 @@
:h5s,
:h6s,
:paragraphs,
:labels,
:file_fields].each do |method_name|
- define_method(method_name) do |name, identifier, &block|
+ define_method(method_name) do |name, identifier=nil, &block|
define_method("#{name}_elements") do
- return call_block(&block) if block_given?
+ return call_block(&block) unless block.nil?
platform.send "#{method_name.to_s}_for", identifier.clone
end
end
end