Method: Cucumber::Glue::ProtoWorld#attach
- Defined in:
- lib/cucumber/glue/proto_world.rb
#attach(file, media_type = nil, filename = nil) ⇒ Object
Attach a file to the output
92 93 94 95 96 97 98 99 100 |
# File 'lib/cucumber/glue/proto_world.rb', line 92 def attach(file, media_type = nil, filename = nil) if File.file?(file) media_type = MiniMime.lookup_by_filename(file)&.content_type if media_type.nil? file = File.read(file, mode: 'rb') end super rescue StandardError super end |