From 28e3c25618398d52712592da5786c1f207881f4c Mon Sep 17 00:00:00 2001 From: Joshua Clayton Date: Tue, 27 Mar 2012 08:58:26 -0400 Subject: [PATCH] AS::Deprecation prefixes messages with 'DEPRECATION WARNING: ' already --- lib/factory_girl/syntax/vintage.rb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/factory_girl/syntax/vintage.rb b/lib/factory_girl/syntax/vintage.rb index d3a79fbe7..83b807dd4 100644 --- a/lib/factory_girl/syntax/vintage.rb +++ b/lib/factory_girl/syntax/vintage.rb @@ -23,7 +23,7 @@ module ::Factory # Yields: +Factory+ # The newly created factory. def self.define(name, options = {}) - ActiveSupport::Deprecation.warn "DEPRECATION WARNING: Factory.define is deprecated; use the FactoryGirl.define block syntax to declare your factory.", caller + ActiveSupport::Deprecation.warn "Factory.define is deprecated; use the FactoryGirl.define block syntax to declare your factory.", caller factory = FactoryGirl::Factory.new(name, options) proxy = FactoryGirl::DefinitionProxy.new(factory) yield(proxy) @@ -46,7 +46,7 @@ def self.define(name, options = {}) # # Factory.sequence(:email) {|n| "somebody_#{n}@example.com" } def self.sequence(name, start_value = 1, &block) - ActiveSupport::Deprecation.warn "DEPRECATION WARNING: Factory.sequence is deprecated; use the FactoryGirl.define block syntax to declare your sequence.", caller + ActiveSupport::Deprecation.warn "Factory.sequence is deprecated; use the FactoryGirl.define block syntax to declare your sequence.", caller FactoryGirl.register_sequence(Sequence.new(name, start_value, &block)) end @@ -59,7 +59,7 @@ def self.sequence(name, start_value = 1, &block) # Returns: # The next value in the sequence. (Object) def self.next(name) - ActiveSupport::Deprecation.warn "DEPRECATION WARNING: Factory.next is deprecated; use FactoryGirl.generate instead.", caller + ActiveSupport::Deprecation.warn "Factory.next is deprecated; use FactoryGirl.generate instead.", caller FactoryGirl.generate(name) end @@ -88,31 +88,31 @@ def self.next(name) # # will be used instead. # Factory(:post, user_id: 1) def self.alias(pattern, replace) - ActiveSupport::Deprecation.warn "DEPRECATION WARNING: Factory.alias is deprecated; use FactoryGirl.aliases << [pattern, replace] instead.", caller + ActiveSupport::Deprecation.warn "Factory.alias is deprecated; use FactoryGirl.aliases << [pattern, replace] instead.", caller FactoryGirl.aliases << [pattern, replace] end # Alias for FactoryGirl.attributes_for def self.attributes_for(name, overrides = {}) - ActiveSupport::Deprecation.warn "DEPRECATION WARNING: Factory.attributes_for is deprecated; use FactoryGirl.attributes_for instead.", caller + ActiveSupport::Deprecation.warn "Factory.attributes_for is deprecated; use FactoryGirl.attributes_for instead.", caller FactoryGirl.attributes_for(name, overrides) end # Alias for FactoryGirl.build def self.build(name, overrides = {}) - ActiveSupport::Deprecation.warn "DEPRECATION WARNING: Factory.build is deprecated; use FactoryGirl.build instead.", caller + ActiveSupport::Deprecation.warn "Factory.build is deprecated; use FactoryGirl.build instead.", caller FactoryGirl.build(name, overrides) end # Alias for FactoryGirl.create def self.create(name, overrides = {}) - ActiveSupport::Deprecation.warn "DEPRECATION WARNING: Factory.create is deprecated; use FactoryGirl.create instead.", caller + ActiveSupport::Deprecation.warn "Factory.create is deprecated; use FactoryGirl.create instead.", caller FactoryGirl.create(name, overrides) end # Alias for FactoryGirl.build_stubbed. def self.stub(name, overrides = {}) - ActiveSupport::Deprecation.warn "DEPRECATION WARNING: Factory.stub is deprecated; use FactoryGirl.build_stubbed instead.", caller + ActiveSupport::Deprecation.warn "Factory.stub is deprecated; use FactoryGirl.build_stubbed instead.", caller FactoryGirl.build_stubbed(name, overrides) end end @@ -122,7 +122,7 @@ def self.stub(name, overrides = {}) # Example: # Factory(:user, name: 'Joe') def Factory(name, attrs = {}) - ActiveSupport::Deprecation.warn "DEPRECATION WARNING: Factory(:name) is deprecated; use FactoryGirl.create(:name) instead.", caller + ActiveSupport::Deprecation.warn "Factory(:name) is deprecated; use FactoryGirl.create(:name) instead.", caller FactoryGirl.create(name, attrs) end end