Sha256: e5f00fb9d8477ed5a3cb2069034bba6db299cc253a4a7babfd1ec827ab92fe2c
Contents?: true
Size: 705 Bytes
Versions: 7
Compression:
Stored size: 705 Bytes
Contents
def attach_or_embed(world, data, media_type) # Backward compatibility as the steps are also used by cucumber-ruby 3 which does not support `attach` world.respond_to?(:attach) ? attach(data, media_type) : embed(data, media_type) end Before do # no-op end Before(name: 'A named hook') do # no-op end When('a step passes') do # no-op end When('a step throws an exception') do raise StandardError, 'Exception in step' end After do raise StandardError, 'Exception in hook' end After('@some-tag or @some-other-tag') do raise StandardError, 'Exception in conditional hook' end After('@with-attachment') do attach_or_embed(self, File.open("#{__dir__}/cucumber.svg"), 'image/svg+xml') end
Version data entries
7 entries across 7 versions & 1 rubygems