Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove unnecessary cucumber LoadError rescue.

  • Loading branch information...
commit 53d1f7db4926dd3f8188883a8c747a8af233a34d 1 parent e6270c5
@myronmarston authored
Showing with 28 additions and 34 deletions.
  1. +28 −34 Rakefile
View
62 Rakefile
@@ -19,52 +19,46 @@ task :cleanup_rcov_files do
rm_rf 'coverage.data'
end
-begin
- permutations = {
- 'fakeweb' => %w( net/http ),
- 'webmock' => %w( net/http httpclient patron em-http-request )
- }
+permutations = {
+ 'fakeweb' => %w( net/http ),
+ 'webmock' => %w( net/http httpclient patron em-http-request )
+}
- require 'cucumber/rake/task'
- namespace :features do
- permutations.each do |http_stubbing_adapter, http_libraries|
- features_subtasks = []
+require 'cucumber/rake/task'
+namespace :features do
+ permutations.each do |http_stubbing_adapter, http_libraries|
+ features_subtasks = []
- namespace http_stubbing_adapter do
- http_libraries.each do |http_lib|
- next if RUBY_PLATFORM =~ /java/ && %w( patron em-http-request ).include?(http_lib)
+ namespace http_stubbing_adapter do
+ http_libraries.each do |http_lib|
+ next if RUBY_PLATFORM =~ /java/ && %w( patron em-http-request ).include?(http_lib)
- sanitized_http_lib = http_lib.gsub('/', '_')
- features_subtasks << "features:#{http_stubbing_adapter}:#{sanitized_http_lib}"
+ sanitized_http_lib = http_lib.gsub('/', '_')
+ features_subtasks << "features:#{http_stubbing_adapter}:#{sanitized_http_lib}"
- task "#{sanitized_http_lib}_prep" do
- ENV['HTTP_STUBBING_ADAPTER'] = http_stubbing_adapter
- ENV['HTTP_LIB'] = http_lib
- end
+ task "#{sanitized_http_lib}_prep" do
+ ENV['HTTP_STUBBING_ADAPTER'] = http_stubbing_adapter
+ ENV['HTTP_LIB'] = http_lib
+ end
- Cucumber::Rake::Task.new(
- { sanitized_http_lib => "#{features_subtasks.last}_prep" },
- "Run the features using #{http_stubbing_adapter} and #{http_lib}") do |t|
- t.cucumber_opts = ['--format', 'progress', '--tags', "@#{http_stubbing_adapter},@all_http_libs,@#{sanitized_http_lib}"]
+ Cucumber::Rake::Task.new(
+ { sanitized_http_lib => "#{features_subtasks.last}_prep" },
+ "Run the features using #{http_stubbing_adapter} and #{http_lib}") do |t|
+ t.cucumber_opts = ['--format', 'progress', '--tags', "@#{http_stubbing_adapter},@all_http_libs,@#{sanitized_http_lib}"]
- # disable scenarios on heroku that can't pass due to heroku's restrictions
- t.cucumber_opts += ['--tags', '~@spawns_localhost_server'] if ENV.keys.include?('HEROKU_SLUG')
- end
+ # disable scenarios on heroku that can't pass due to heroku's restrictions
+ t.cucumber_opts += ['--tags', '~@spawns_localhost_server'] if ENV.keys.include?('HEROKU_SLUG')
end
end
-
- desc "Run the features using #{http_stubbing_adapter} and each of #{http_stubbing_adapter}'s supported http libraries"
- task http_stubbing_adapter => features_subtasks
end
- end
- desc "Run the features using each supported permutation of http stubbing library and http library."
- task :features => permutations.keys.map { |a| "features:#{a}" }
-rescue LoadError
- task :features do
- abort "Cucumber is not available. In order to run features, you must: sudo gem install cucumber"
+ desc "Run the features using #{http_stubbing_adapter} and each of #{http_stubbing_adapter}'s supported http libraries"
+ task http_stubbing_adapter => features_subtasks
end
end
+desc "Run the features using each supported permutation of http stubbing library and http library."
+task :features => permutations.keys.map { |a| "features:#{a}" }
+
task :default => [:spec, :features]
Please sign in to comment.
Something went wrong with that request. Please try again.