Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Support for both rspec-1.x and rspec-2.x
  • Loading branch information
louismrose authored and aslakhellesoy committed Feb 24, 2010
1 parent 2bc67dd commit 2a236f8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
1 change: 1 addition & 0 deletions History.txt
@@ -1,6 +1,7 @@
== In Git

=== New Features
* Support for both rspec-1.x and rspec-2.x (Louis Rose, Aslak Hellesøy)
* Generated features will default to @emulate_rails_javascript instead of @culerity (Aslak Hellesøy)
* Support for Rails3 (WORK IN PROGRESS) (#10 Kristian Mandrup, Aleksey Gureiev, Ashley Moran, Aslak Hellesøy)
* Japanese translation. (MOROHASHI Kyosuke)
Expand Down
27 changes: 20 additions & 7 deletions lib/cucumber/rails/rspec.rb
@@ -1,10 +1,23 @@
require 'cucumber/rails/world'
require 'spec/expectations'
require 'spec/rails'

[Cucumber::Rails::World, ActionController::Integration::Session].each do |klass|
klass.class_eval do
include Spec::Matchers
include Spec::Rails::Matchers
begin
require 'rspec/expectations'
require 'rspec/rails'

[Cucumber::Rails::World, ActionController::Integration::Session].each do |klass|
klass.class_eval do
include Rspec::Matchers
include Rspec::Rails::Matchers
end
end
rescue LoadError => try_rspec_1
require 'spec/expectations'
require 'spec/rails'

[Cucumber::Rails::World, ActionController::Integration::Session].each do |klass|
klass.class_eval do
include Spec::Matchers
include Spec::Rails::Matchers
end
end
end
end

0 comments on commit 2a236f8

Please sign in to comment.