lib/rspec/example_steps.rb in rspec-example_steps-0.2.0 vs lib/rspec/example_steps.rb in rspec-example_steps-0.2.1
- old
+ new
@@ -14,9 +14,13 @@
RSpec::Core::Formatters::DocumentationFormatter.send :include, RSpec::ExampleSteps::DocumentationFormatter
RSpec::Core::ExampleGroup.send :include, RSpec::ExampleSteps::ExampleGroup
RSpec::Core::Reporter.send :include, RSpec::ExampleSteps::Reporter
RSpec::Core::World.send :include, RSpec::ExampleSteps::World
-RSpec::Core::ExampleGroup.define_example_method :Steps, :with_steps => true
+if RSpec::Core::ExampleGroup.singleton_class.respond_to?(:define_example_method)
+ RSpec::Core::ExampleGroup.singleton_class.define_example_method :Steps, :with_steps => true
+else
+ RSpec::Core::ExampleGroup.define_example_method :Steps, :with_steps => true
+end
require 'rspec/example_steps/shared_steps'
include RSpec::ExampleSteps::SharedSteps