From 0d813545516393ef30e229e342bf58c9229be30b Mon Sep 17 00:00:00 2001 From: Noel Rappin Date: Mon, 2 Jun 2014 10:17:29 -0500 Subject: [PATCH 1/2] fix for rspec deprecation --- lib/draper/test/rspec_integration.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/draper/test/rspec_integration.rb b/lib/draper/test/rspec_integration.rb index e631714..013d8ff 100755 --- a/lib/draper/test/rspec_integration.rb +++ b/lib/draper/test/rspec_integration.rb @@ -7,7 +7,7 @@ module Draper end RSpec.configure do |config| - config.include DecoratorExampleGroup, example_group: {file_path: %r{spec/decorators}}, type: :decorator + config.include DecoratorExampleGroup, file_path: %r{spec/decorators}, type: :decorator [:decorator, :controller, :mailer].each do |type| config.before(:each, type: type) { Draper::ViewContext.clear! } From 0304374b1f64414d2890e81bce6731d8a785970d Mon Sep 17 00:00:00 2001 From: Noel Rappin Date: Mon, 2 Jun 2014 10:34:32 -0500 Subject: [PATCH 2/2] version specific change --- lib/draper/test/rspec_integration.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/draper/test/rspec_integration.rb b/lib/draper/test/rspec_integration.rb index 013d8ff..d18f636 100755 --- a/lib/draper/test/rspec_integration.rb +++ b/lib/draper/test/rspec_integration.rb @@ -7,7 +7,11 @@ module Draper end RSpec.configure do |config| - config.include DecoratorExampleGroup, file_path: %r{spec/decorators}, type: :decorator + if RSpec::Core::Version::STRING.starts_with?("3") + config.include DecoratorExampleGroup, file_path: %r{spec/decorators}, type: :decorator + else + config.include DecoratorExampleGroup, example_group: {file_path: %r{spec/decorators}}, type: :decorator + end [:decorator, :controller, :mailer].each do |type| config.before(:each, type: type) { Draper::ViewContext.clear! }