Permalink
Browse files

Add spec command for backward compatibility

- provides notice explaining
  - use rspec for rspec-2, spec for rspec-1
  - how to use spec if you have both versions installed
  • Loading branch information...
dchelimsky committed Oct 24, 2010
1 parent 4f29280 commit 6f87308dcad18ed7fdf41a0bf8f8c09cc02190fc
Showing with 24 additions and 0 deletions.
  1. +18 −0 bin/spec
  2. +6 −0 spec/rspec/deprecation_spec.rb
View
@@ -0,0 +1,18 @@
+#!/usr/bin/env ruby
+require 'rspec/core'
+RSpec.warn_deprecation <<-WARNING
+*************************************************************************
+NOTICE: The 'spec' command was changed to 'rspec' in RSpec-2.
+
+To run examples with rspec-2, please use:
+
+ rspec #{ARGV.join(' ')}
+
+If you are trying to run specs using rspec-1, make sure rspec-1 is installed in
+this environment, and then run it with the version argument:
+
+ spec _1.3.1_ #{ARGV.join(' ')}
+
+*************************************************************************
+WARNING
+require 'rspec/autorun'
@@ -0,0 +1,6 @@
+describe "spec command" do
+ it "is deprecated" do
+ RSpec.should_receive(:warn_deprecation)
+ load File.expand_path('../../../bin/spec', __FILE__)
+ end
+end

0 comments on commit 6f87308

Please sign in to comment.