Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Upgrade infrastructure: RSpec

  • Loading branch information...
commit 4edc83156c31c52ffd6569e9a0d7a1d1db460dbb 1 parent 335134d
@luislavena luislavena authored
Showing with 11 additions and 21 deletions.
  1. +1 −1  Isolate
  2. +5 −10 spec/spec_helper.rb
  3. +5 −10 tasks/rspec.rake
View
2  Isolate
@@ -1,5 +1,5 @@
gem 'rake'
-gem 'rspec', '~> 1.3.1'
+gem 'rspec', '~> 2.6.0'
gem 'cucumber', '~> 0.9.4'
unless RUBY_PLATFORM =~ /java/
View
15 spec/spec_helper.rb
@@ -1,19 +1,14 @@
-# add lib directory to the search path
-libdir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
-$LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir)
-
-require 'rubygems'
-require 'spec'
+require 'rspec'
# Console redirection helper
-require File.expand_path(File.join(File.dirname(__FILE__), 'support/capture_output_helper'))
+require File.expand_path('../support/capture_output_helper', __FILE__)
-Spec::Runner.configure do |config|
- include CaptureOutputHelper
+RSpec.configure do |config|
+ config.include CaptureOutputHelper
end
# Rake::Task matcher helper
-Spec::Matchers.define :have_defined do |task|
+RSpec::Matchers.define :have_defined do |task|
match do |tasks|
tasks.task_defined?(task)
end
View
15 tasks/rspec.rake
@@ -1,5 +1,5 @@
begin
- require 'spec/rake/spectask'
+ require "rspec/core/rake_task"
begin
require 'rcov'
@@ -11,21 +11,16 @@ rescue LoadError
warn "RSpec gem is required, please install it (gem install rspec)."
end
-if defined?(Spec)
- Spec::Rake::SpecTask.new(:spec) do |t|
- t.spec_opts = ["--options", "spec/spec.opts"]
- t.spec_files = FileList["spec/**/*_spec.rb"]
- end
+if defined?(RSpec::Core::RakeTask)
+ RSpec::Core::RakeTask.new(:spec)
if defined?(Rcov)
CLOBBER.include('coverage')
namespace :spec do
desc "Run all specs in spec directory with RCov"
- Spec::Rake::SpecTask.new(:rcov) do |t|
- t.spec_opts = ["--options", "spec/spec.opts"]
- t.spec_files = FileList["spec/**/*_spec.rb"]
- t.rcov = true
+ RSpec::Core::RakeTask.new(:rcov) do |t|
+ t.rcov = true
t.rcov_opts = ["--exclude", "spec/*,features/*,gems/*"]
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.