Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Specs now run under RSpec 2.

Updated documentation

  - seperate readme for devs
  - notes on moving to rspec2

Removed rspec_opts from rakefiles

  - added .rspec file to put configuration options in
  - removed obsolete --diff command line option

Fix runner spec

  - shared example group upgraded to rspec2 syntax

Spec Helper

  - Applied configuration fix suggested by David Chelimsky on rspec_users

This work started from railsjedi's branch of the project many thanks

  - https://github.com/railsjedi/cucumber-tmbundle
  • Loading branch information...
commit 07902557574ad435b2345946ab73a0fbe2cab6d9 1 parent a181b97
@diabolo diabolo authored
View
1  .rspec
@@ -0,0 +1 @@
+--color
View
5 .rvmrc.sample
@@ -5,3 +5,8 @@
# 3. accept use of .rvmrc
# please do not commit a .rvmrc
rvm --create use 1.8.7@cucumber-tmbundle > /dev/null
+
+# change your gemset when you upgrade to rspec 2
+rvm --create use 1.8.7@cucumber-tmbundle-rspec2 > /dev/null
+
+
View
30 DEV_README.markdown
@@ -0,0 +1,30 @@
+For Developers Only
+===================
+
+If you are just using this bundle then this file is not for you!
+
+Running Specs
+-------------
+
+This project relies on rvm and bundler for doing development. Its suggested you use the .rvmrc.sample file to set a project environment then
+
+1. install bundler
+1. run bundle install
+
+Now you should be able to run both
+
+1. `rake spec`
+1. `spec support/spec`
+
+Upgrading to RSpec 2
+--------------------
+
+If you have been working on this project using rspec1 then its important when upgrading to rspec2, to use a separate gemset and install all gems from scratch, to avoid any pollution from the old gemset.
+
+* modify .rvmrc file (change the gemset e.g. to xxx_rspec2)
+* cd out and back into folder
+* check no gems are installed `gem list --local`
+* `gem install bundler`
+* `bundle install`
+
+Now if things don't work we know its our fault
View
2  Gemfile
@@ -1,6 +1,6 @@
source "http://rubygems.org"
-gem "rspec", "~> 1.3.2"
+gem "rspec", "~> 2.6.0"
gem "rcov"
gem "cucumber"
View
11 Gemfile.lock
@@ -18,7 +18,14 @@ GEM
linecache19 (0.5.12)
ruby_core_source (>= 0.1.4)
rcov (0.9.9)
- rspec (1.3.2)
+ rspec (2.6.0)
+ rspec-core (~> 2.6.0)
+ rspec-expectations (~> 2.6.0)
+ rspec-mocks (~> 2.6.0)
+ rspec-core (2.6.3)
+ rspec-expectations (2.6.0)
+ diff-lcs (~> 1.1.2)
+ rspec-mocks (2.6.0)
ruby-debug (0.10.4)
columnize (>= 0.1)
ruby-debug-base (~> 0.10.4.0)
@@ -42,6 +49,6 @@ PLATFORMS
DEPENDENCIES
cucumber
rcov
- rspec (~> 1.3.2)
+ rspec (~> 2.6.0)
ruby-debug
ruby-debug19
View
11 README.markdown
@@ -9,15 +9,6 @@ Please see the original project for more details.
Things Specific to this Fork
============================
-Running Specs
--------------
+There is now a developers readme, please read this if you are hacking this bundle.
-This project relies on rvm and bundler for doing development. Its suggested you use the .rvmrc.sample file to set a project environment then
-1. install bundler
-1. run bundle install
-
-Now you should be able to run both
-
-1. `rake spec`
-1. `spec support/spec`
View
7 Rakefile
@@ -1,12 +1,11 @@
$:.unshift(File.dirname(__FILE__) + '/../../rspec/lib')
require 'rubygems'
-require 'spec/rake/spectask'
+require 'rspec/core/rake_task'
desc "Run all specs"
-Spec::Rake::SpecTask.new do |t|
- t.spec_files = FileList['support/spec/**/*_spec.rb']
+RSpec::Core::RakeTask.new do |t|
+ t.pattern = 'support/spec/**/*_spec.rb'
t.rcov = true
- t.spec_opts = ['--colour', '--diff']
t.rcov_opts = ['--exclude', 'TextMate.app,gem,rspec\/plugins,rspec\/lib\/spec,spec\/spec,fixtures,bin\/spec']
end
View
11 support/Rakefile
@@ -1,13 +1,16 @@
$:.unshift(File.dirname(__FILE__) + '/../../rspec/lib')
require 'rubygems'
-require 'spec/rake/spectask'
+require 'rspec/core/rake_task'
desc "Run all specs"
-Spec::Rake::SpecTask.new do |t|
+Rspec::Core::RakeTask.new do |t|
t.rcov = true
- t.spec_opts = ['--colour', '--diff']
t.rcov_opts = ['--exclude', 'rspec\/plugins,rspec\/lib\/spec,spec\/spec,fixtures,bin\/spec']
end
-Dir['bundle_tasks/**/*.rake'].each { |rake| load rake }
+
+
+
+
View
2  support/spec/cucumber/mate/runner_spec.rb
@@ -3,7 +3,7 @@
module Cucumber
module Mate
- describe "a run command", :shared => true do
+ shared_examples "a run command" do
it "should run with the cucumber command by default" do
expect_system_call_to_be_made_with(%r[#{Cucumber::Mate::Runner::CUCUMBER_BIN}])
when_run_is_called
View
12 support/spec/spec_helper.rb
@@ -1,10 +1,12 @@
require 'rubygems'
-require 'spec'
+require 'rspec/core'
ENV['TM_SUPPORT_PATH'] = '/Applications/TextMate.app/Contents/SharedSupport/Support'
-module Spec::Example::ExampleMethods
- def project_root
- @project_root ||= File.expand_path(File.join(File.dirname(__FILE__), '../fixtures'))
- end
+RSpec.configure do |c|
+ c.include(Module.new do
+ def project_root
+ @project_root ||= File.expand_path(File.join(File.dirname(__FILE__), '../fixtures'))
+ end
+ end)
end
Please sign in to comment.
Something went wrong with that request. Please try again.