Sha256: 881898f3b9b85eaa75f41b9468152db252019f3c5106195b5363ac8076cb38c6

Contents?: true

Size: 1020 Bytes

Versions: 27

Compression:

Stored size: 1020 Bytes

Contents

Given /^the following Rack app:$/ do |definition|
  File.open(RACK_FILE, 'w') { |file| file.write(definition) }
end

When /^I add "([^\"]*)" requirement(?: with "([^\"]*)" option)?$/ do |gem,option|
  append_to_gemfile("gem '#{gem}'#{option ? ", #{option}":""}")
end

When /^I initialize Gemfile$/ do
  step %{I run `bundle init`}
end

When /^I perform a Rack request to "([^\"]*)"$/ do |url|
  shim_file = File.join(PROJECT_ROOT, 'features', 'support', 'airbrake_shim.rb.template')
  request_file = File.join(TEMP_DIR, 'rack_request.rb')
  File.open(request_file, 'w') do |file|
    file.puts "require 'rubygems'"
    file.puts IO.read(shim_file)
    file.puts IO.read(RACK_FILE)
    file.puts "env = Rack::MockRequest.env_for(#{url.inspect})"
    file.puts "status, headers, body = app.call(env)"
    file.puts %{puts "HTTP \#{status}"}
    file.puts %{headers.each { |key, value| puts "\#{key}: \#{value}"}}
    file.puts "body.each { |part| print part }"
  end
  step %{I run `bundle exec ruby #{request_file}`}
end

Version data entries

27 entries across 27 versions & 2 rubygems

Version Path
airbrakeV4rails5-4.3.8 features/step_definitions/rack_steps.rb
airbrake-4.3.8 features/step_definitions/rack_steps.rb
airbrake-4.3.7 features/step_definitions/rack_steps.rb
airbrake-4.3.6 features/step_definitions/rack_steps.rb
airbrake-4.3.5 features/step_definitions/rack_steps.rb
airbrake-4.3.4 features/step_definitions/rack_steps.rb
airbrake-4.3.3 features/step_definitions/rack_steps.rb
airbrake-4.3.2 features/step_definitions/rack_steps.rb
airbrake-4.3.1 features/step_definitions/rack_steps.rb
airbrake-4.3.0 features/step_definitions/rack_steps.rb
airbrake-4.2.1 features/step_definitions/rack_steps.rb
airbrake-4.2.0 features/step_definitions/rack_steps.rb
airbrake-4.1.0 features/step_definitions/rack_steps.rb
airbrake-4.0.0 features/step_definitions/rack_steps.rb
airbrake-3.2.1 features/step_definitions/rack_steps.rb
airbrake-3.2.0 features/step_definitions/rack_steps.rb
airbrake-3.1.17 features/step_definitions/rack_steps.rb
airbrake-3.1.16 features/step_definitions/rack_steps.rb
airbrake-3.1.15 features/step_definitions/rack_steps.rb
airbrake-3.1.14 features/step_definitions/rack_steps.rb