Permalink
Browse files

Remove cargo-culted LoadError rescues

  • Loading branch information...
1 parent f104d15 commit 6335c227126e0d9ea46f6e7723652cca49f9e1b9 @kytrinyx kytrinyx committed Aug 16, 2012
Showing with 13 additions and 64 deletions.
  1. +8 −34 lib/generators/daemon_kit/rspec/templates/tasks/rspec.rake
  2. +5 −30 tasks/rspec.rake
@@ -1,37 +1,11 @@
-begin
- require 'rspec'
-rescue LoadError
- begin
- require 'rubygems'
- require 'rspec'
- rescue LoadError
- puts <<-EOS
-To use rspec for testing you must install rspec gem:
+require 'rspec'
+require 'rspec/core/rake_task'
- gem install rspec
-
-or add it to your Gemfile and install it:
-
- echo "gem 'rspec'" >> Gemfile
- bundle install
-
-EOS
- exit 1
- end
+desc "Run the specs under spec/"
+RSpec::Core::RakeTask.new do |t|
+ t.rspec_opts = ['--options', "spec/spec.opts"]
end
-begin
- require 'rspec/core/rake_task'
-
- desc "Run the specs under spec/"
- RSpec::Core::RakeTask.new do |t|
- t.rspec_opts = ['--options', "spec/spec.opts"]
- end
-
- # Want other tests/tasks run by default?
- # Add them to the list
- task :default => [:spec] #, :features]
-
-rescue LoadError, NameError
- puts "Unable to define the rake spec task"
-end
+# Want other tests/tasks run by default?
+# Add them to the list
+task :default => [:spec] #, :features]
View
@@ -1,32 +1,7 @@
-begin
- require 'rspec'
-rescue LoadError
- begin
- require 'rubygems'
- require 'rspec'
- rescue LoadError
- puts <<-EOS
-To use rspec for testing you must install rspec gem:
+require 'rspec'
+require 'rspec/core/rake_task'
- gem install rspec
-
-or add it to your Gemfile and install it:
-
- echo "gem 'rspec'" >> Gemfile
- bundle install
-
-EOS
- exit 1
- end
-end
-
-begin
- require 'rspec/core/rake_task'
-
- desc "Run the specs under spec/"
- RSpec::Core::RakeTask.new do |t|
- t.rspec_opts = ['--options', "spec/spec.opts"]
- end
-rescue LoadError, NameError
- puts "Unable to define the rake spec task"
+desc "Run the specs under spec/"
+RSpec::Core::RakeTask.new do |t|
+ t.rspec_opts = ['--options', "spec/spec.opts"]
end

0 comments on commit 6335c22

Please sign in to comment.