Sha256: ecf0d0fa1d10657c221043054c563e0d773a29ae0e2959eaccd40e073c9d3795

Contents?: true

Size: 658 Bytes

Versions: 3

Compression:

Stored size: 658 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

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

3 entries across 3 versions & 1 rubygems

Version Path
cucumber-compatibility-kit-9.1.2 features/hooks/hooks.feature.rb
cucumber-compatibility-kit-9.1.1 features/hooks/hooks.feature.rb
cucumber-compatibility-kit-9.1.0 features/hooks/hooks.feature.rb