Sha256: 84dca2d1af3b85f3e06d21d120219e658cd33dff1c0a0cc65d4118377c11c4b7

Contents?: true

Size: 470 Bytes

Versions: 9

Compression:

Stored size: 470 Bytes

Contents

Then(/^I(?: can)? run the code:$/) do |code|
  @result = eval(code).tap do |result|
    puts result if ENV['DEBUG']
  end
end

Then(/^this code should fail with "([^"]*)"$/) do |error_msg, code|
  begin
    @result = eval(code)
  rescue Exception => exc
    if not exc.message =~ %r{#{error_msg}}
      fail "'#{error_msg}' was not found in '#{exc.message}'"
    end
  else
    puts @result if ENV['DEBUG']
    fail "The provided block did not raise an error"
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
conjur-api-5.3.8.pre.194 features/step_definitions/api_steps.rb
conjur-api-5.3.7 features/step_definitions/api_steps.rb
conjur-api-5.3.7.pre.183 features/step_definitions/api_steps.rb
conjur-api-5.3.7.pre.168 features/step_definitions/api_steps.rb
conjur-api-5.3.7.pre.14 features/step_definitions/api_steps.rb
conjur-api-5.3.7.pre.167 features/step_definitions/api_steps.rb
conjur-api-5.3.6 features/step_definitions/api_steps.rb
conjur-api-5.3.5 features/step_definitions/api_steps.rb
conjur-api-5.3.4 features/step_definitions/api_steps.rb