Permalink
Browse files

update plugin

  • Loading branch information...
1 parent dfb8bd1 commit 2f6c9f5640da78d249c740bf9fedf81ee68dfbed @technoweenie committed Sep 28, 2008
Showing with 33 additions and 28 deletions.
  1. +3 −2 lib/viking/viking.rb
  2. +30 −26 tasks/rspec.rake
View
@@ -41,9 +41,10 @@ def enabled?
end
def connect(engine, options)
- unless engine.nil? || engine.empty?
+ engine = engine.to_s
+ unless engine.size.zero?
require(engine)
- Viking.const_get(engine.to_s.capitalize).new(options)
+ Viking.const_get(engine.capitalize).new(options)
end
end
View
@@ -1,31 +1,35 @@
begin
- require 'spec'
-rescue LoadError
- require 'rubygems'
- require 'spec'
-end
-begin
- require 'spec/rake/spectask'
-rescue LoadError
- puts "To use RSpec for testing you must install its gem:\n\tgem install rspec"
- exit(0)
-end
+ begin
+ require 'spec'
+ rescue LoadError
+ require 'rubygems'
+ require 'spec'
+ end
+ begin
+ require 'spec/rake/spectask'
+ rescue LoadError
+ puts "To use RSpec for testing you must install its gem:\n\tgem install rspec"
+ exit(0)
+ end
-SPEC_OPTS_FILE = [
- "-O",
- File.join(File.dirname(__FILE__), "..", "spec", "spec.opts")
- ].join(" ")
+ SPEC_OPTS_FILE = [
+ "-O",
+ File.join(File.dirname(__FILE__), "..", "spec", "spec.opts")
+ ].join(" ")
-desc "Run all specs"
-Spec::Rake::SpecTask.new 'spec' do |t|
- t.spec_files = FileList["spec/**/*_spec.rb"]
- t.spec_opts = [SPEC_OPTS_FILE]
-end
+ desc "Run all specs"
+ Spec::Rake::SpecTask.new 'spec' do |t|
+ t.spec_files = FileList["spec/**/*_spec.rb"]
+ t.spec_opts = [SPEC_OPTS_FILE]
+ end
-desc "Run all specs with RCov"
-Spec::Rake::SpecTask.new 'specs_with_rcov' do |t|
- t.spec_opts = [SPEC_OPTS_FILE]
- t.spec_files = FileList["spec/**/*_spec.rb"]
- t.rcov = true
- t.rcov_opts = ['--exclude', 'spec']
+ desc "Run all specs with RCov"
+ Spec::Rake::SpecTask.new 'specs_with_rcov' do |t|
+ t.spec_opts = [SPEC_OPTS_FILE]
+ t.spec_files = FileList["spec/**/*_spec.rb"]
+ t.rcov = true
+ t.rcov_opts = ['--exclude', 'spec']
+ end
+rescue LoadError
+ # no rspec
end

0 comments on commit 2f6c9f5

Please sign in to comment.