Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove cargo-culted LoadError rescues

  • Loading branch information...
commit 6335c227126e0d9ea46f6e7723652cca49f9e1b9 1 parent f104d15
@kytrinyx kytrinyx authored
View
42 lib/generators/daemon_kit/rspec/templates/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
35 tasks/rspec.rake
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.