diff options
author | Daniel DeLeo <dan@opscode.com> | 2011-03-04 09:01:53 -0800 |
---|---|---|
committer | Daniel DeLeo <dan@opscode.com> | 2011-03-04 09:01:53 -0800 |
commit | 0dee0929cf660f02e474ee488e54a37b15b8c79d (patch) | |
tree | 15d18c719700ee56c417b4a43119a1faec62059a | |
parent | 7cf27dd96755216d14507bc6baeda3e50bbd64ea (diff) | |
download | mixlib-log-0dee0929cf660f02e474ee488e54a37b15b8c79d.tar.gz |
upgrade to rspec 2
-rw-r--r-- | .rspec | 2 | ||||
-rw-r--r-- | Rakefile | 23 | ||||
-rw-r--r-- | spec/mixlib/log_spec.rb | 3 | ||||
-rw-r--r-- | spec/spec.opts | 4 |
4 files changed, 7 insertions, 25 deletions
@@ -0,0 +1,2 @@ +--colour +--format documentation @@ -20,34 +20,17 @@ rescue LoadError end begin - require 'spec/rake/spectask' - Spec::Rake::SpecTask.new(:spec) do |spec| - spec.libs << 'lib' << 'spec' - spec.spec_opts = ['--options', "\"#{File.dirname(__FILE__)}/spec/spec.opts\""] - spec.spec_files = FileList['spec/**/*_spec.rb'] - end - - Spec::Rake::SpecTask.new(:rcov) do |spec| - spec.libs << 'lib' << 'spec' + require 'rspec/core/rake_task' + RSpec::Core::RakeTask.new(:spec) do |spec| spec.pattern = 'spec/**/*_spec.rb' - spec.rcov = true end + rescue LoadError task :spec do abort "Rspec is not available. (sudo) gem install rspec to run unit tests" end end - -begin - require 'cucumber/rake/task' - Cucumber::Rake::Task.new(:features) -rescue LoadError - task :features do - abort "Cucumber is not available. In order to run features, you must: sudo gem install cucumber" - end -end - task :default => :spec require 'rake/rdoctask' diff --git a/spec/mixlib/log_spec.rb b/spec/mixlib/log_spec.rb index d064871..57c8a5b 100644 --- a/spec/mixlib/log_spec.rb +++ b/spec/mixlib/log_spec.rb @@ -18,6 +18,7 @@ # require 'tempfile' +require 'stringio' require File.expand_path(File.join(File.dirname(__FILE__), "..", "spec_helper")) describe Mixlib::Log do @@ -98,7 +99,7 @@ describe Mixlib::Log do end it "should default to STDOUT if init is called with no arguments" do - logger_mock = mock(Logger, :null_object => true) + logger_mock = Struct.new(:formatter, :level).new Logger.stub!(:new).and_return(logger_mock) Logger.should_receive(:new).with(STDOUT).and_return(logger_mock) Logit.init diff --git a/spec/spec.opts b/spec/spec.opts deleted file mode 100644 index 7636dbe..0000000 --- a/spec/spec.opts +++ /dev/null @@ -1,4 +0,0 @@ ---colour ---format specdoc ---loadby mtime ---reverse |