Skip to content
Browse files

Upgrade RSpec from version 1.x to 2.x

  • Loading branch information...
1 parent feb5e96 commit 8e16e2c0313ded0bfef8fb703a1b2d5562c5a3aa @esambo esambo committed Nov 23, 2011
Showing with 21 additions and 15 deletions.
  1. +9 −10 Rakefile
  2. +1 −1 features/support/env.rb
  3. +11 −4 spec/spec_helper.rb
View
19 Rakefile
@@ -18,25 +18,24 @@ rescue LoadError
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
end
-require 'spec/rake/spectask'
-Spec::Rake::SpecTask.new(:spec) do |spec|
- spec.libs << 'lib' << 'spec'
- spec.spec_files = FileList['spec/**/*_spec.rb']
+require 'rspec/core/rake_task'
+RSpec::Core::RakeTask.new(:spec) do |spec|
+ # spec.rspec_opts = ['--format progress', '--color', '-r ./spec/spec_helper.rb']
+ # spec.rspec_opts = ['--format doc', '--color']
end
-Spec::Rake::SpecTask.new(:rcov) do |spec|
- spec.libs << 'lib' << 'spec'
+RSpec::Core::RakeTask.new(:rcov) do |spec|
spec.pattern = 'spec/**/*_spec.rb'
spec.rcov = true
end
-task :spec => :check_dependencies
+# task :spec => :check_dependencies
begin
require 'cucumber/rake/task'
Cucumber::Rake::Task.new(:features)
- task :features => :check_dependencies
+ # task :features => :check_dependencies
rescue LoadError
task :features do
abort "Cucumber is not available. In order to run features, you must: sudo gem install cucumber"
@@ -45,8 +44,8 @@ end
task :default => :spec
-require 'rake/rdoctask'
-Rake::RDocTask.new do |rdoc|
+require 'rdoc/task'
+RDoc::Task.new do |rdoc|
if File.exist?('VERSION')
version = File.read('VERSION')
else
View
2 features/support/env.rb
@@ -1,4 +1,4 @@
$LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../lib')
require 'game_of_life'
-require 'spec/expectations'
+require 'rspec/expectations'
View
15 spec/spec_helper.rb
@@ -1,9 +1,16 @@
$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'game_of_life'
-require 'spec'
-require 'spec/autorun'
-
-Spec::Runner.configure do |config|
+require 'rspec'
+require 'rspec/autorun'
+RSpec.configure do |config|
+ # == Mock Framework
+ #
+ # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
+ #
+ # config.mock_with :mocha
+ # config.mock_with :flexmock
+ # config.mock_with :rr
+ config.mock_with :rspec
end

0 comments on commit 8e16e2c

Please sign in to comment.
Something went wrong with that request. Please try again.