lib/calabash-cucumber/failure_helpers.rb in calabash-cucumber-0.22.2 vs lib/calabash-cucumber/failure_helpers.rb in calabash-cucumber-0.23.0
- old
+ new
@@ -50,10 +50,14 @@
# @return {String} path to the generated screenshot
def screenshot_embed(options={:prefix => nil, :name => nil, :label => nil})
path = screenshot(options)
filename = options[:label] || File.basename(path)
if self.respond_to?(:embed)
- embed(path, 'image/png', filename)
+ begin
+ embed(path, 'image/png', filename)
+ rescue NoMethodError
+ attach(path, 'image/png')
+ end
else
RunLoop.log_info2("Embed is not available in this context. Will not embed.")
end
true
end