suite_condition("Curb is not useful on JRuby") do
  RUBY_PLATFORM != 'java'
end

# There appears to be a bug in later curbs (> 0.8.6) that manifests in hangs of
# this suite when run on Ruby 1.8.7 or REE, so don't run against that version
# on those Rubies.
curb_version_spec = RUBY_VERSION == "1.8.7" ? '0.8.5' : '~>0.8.8'
gemfile <<-RB
  gem 'curb', '#{curb_version_spec}'
  gem 'rack'
  gem 'json', :platforms => [:rbx, :mri_18]

  # We try translating URIs through Addressable if it's there, so test with it.
  gem 'addressable', '2.3.8', :require => 'addressable/uri' # addressable >= 2.4.0 does not support Ruby 1.8.7
RB

gemfile <<-RB
  gem 'curb', '#{curb_version_spec}'
  gem 'rack'
  gem 'json', :platforms => [:rbx, :mri_18]
RB

# Older curb's than 0.8.6 don't build against Ruby 2.2.0
if RUBY_VERSION < "2.2.0"
gemfile <<-RB
  gem 'curb', '0.8.1'
  gem 'rack'
  gem 'json', :platforms => [:rbx, :mri_18]
RB
end
