Skip to content
This repository
Browse code

AS::Deprecation prefixes messages with 'DEPRECATION WARNING: ' already

  • Loading branch information...
commit 28e3c25618398d52712592da5786c1f207881f4c 1 parent bca13f1
Joshua Clayton authored March 27, 2012

Showing 1 changed file with 9 additions and 9 deletions. Show diff stats Hide diff stats

  1. 18  lib/factory_girl/syntax/vintage.rb
18  lib/factory_girl/syntax/vintage.rb
@@ -23,7 +23,7 @@ module ::Factory
23 23
         # Yields: +Factory+
24 24
         # The newly created factory.
25 25
         def self.define(name, options = {})
26  
-          ActiveSupport::Deprecation.warn "DEPRECATION WARNING: Factory.define is deprecated; use the FactoryGirl.define block syntax to declare your factory.", caller
  26
+          ActiveSupport::Deprecation.warn "Factory.define is deprecated; use the FactoryGirl.define block syntax to declare your factory.", caller
27 27
           factory = FactoryGirl::Factory.new(name, options)
28 28
           proxy = FactoryGirl::DefinitionProxy.new(factory)
29 29
           yield(proxy)
@@ -46,7 +46,7 @@ def self.define(name, options = {})
46 46
         #
47 47
         #   Factory.sequence(:email) {|n| "somebody_#{n}@example.com" }
48 48
         def self.sequence(name, start_value = 1, &block)
49  
-          ActiveSupport::Deprecation.warn "DEPRECATION WARNING: Factory.sequence is deprecated; use the FactoryGirl.define block syntax to declare your sequence.", caller
  49
+          ActiveSupport::Deprecation.warn "Factory.sequence is deprecated; use the FactoryGirl.define block syntax to declare your sequence.", caller
50 50
           FactoryGirl.register_sequence(Sequence.new(name, start_value, &block))
51 51
         end
52 52
 
@@ -59,7 +59,7 @@ def self.sequence(name, start_value = 1, &block)
59 59
         # Returns:
60 60
         #   The next value in the sequence. (Object)
61 61
         def self.next(name)
62  
-          ActiveSupport::Deprecation.warn "DEPRECATION WARNING: Factory.next is deprecated; use FactoryGirl.generate instead.", caller
  62
+          ActiveSupport::Deprecation.warn "Factory.next is deprecated; use FactoryGirl.generate instead.", caller
63 63
           FactoryGirl.generate(name)
64 64
         end
65 65
 
@@ -88,31 +88,31 @@ def self.next(name)
88 88
         #   # will be used instead.
89 89
         #   Factory(:post, user_id: 1)
90 90
         def self.alias(pattern, replace)
91  
-          ActiveSupport::Deprecation.warn "DEPRECATION WARNING: Factory.alias is deprecated; use FactoryGirl.aliases << [pattern, replace] instead.", caller
  91
+          ActiveSupport::Deprecation.warn "Factory.alias is deprecated; use FactoryGirl.aliases << [pattern, replace] instead.", caller
92 92
           FactoryGirl.aliases << [pattern, replace]
93 93
         end
94 94
 
95 95
         # Alias for FactoryGirl.attributes_for
96 96
         def self.attributes_for(name, overrides = {})
97  
-          ActiveSupport::Deprecation.warn "DEPRECATION WARNING: Factory.attributes_for is deprecated; use FactoryGirl.attributes_for instead.", caller
  97
+          ActiveSupport::Deprecation.warn "Factory.attributes_for is deprecated; use FactoryGirl.attributes_for instead.", caller
98 98
           FactoryGirl.attributes_for(name, overrides)
99 99
         end
100 100
 
101 101
         # Alias for FactoryGirl.build
102 102
         def self.build(name, overrides = {})
103  
-          ActiveSupport::Deprecation.warn "DEPRECATION WARNING: Factory.build is deprecated; use FactoryGirl.build instead.", caller
  103
+          ActiveSupport::Deprecation.warn "Factory.build is deprecated; use FactoryGirl.build instead.", caller
104 104
           FactoryGirl.build(name, overrides)
105 105
         end
106 106
 
107 107
         # Alias for FactoryGirl.create
108 108
         def self.create(name, overrides = {})
109  
-          ActiveSupport::Deprecation.warn "DEPRECATION WARNING: Factory.create is deprecated; use FactoryGirl.create instead.", caller
  109
+          ActiveSupport::Deprecation.warn "Factory.create is deprecated; use FactoryGirl.create instead.", caller
110 110
           FactoryGirl.create(name, overrides)
111 111
         end
112 112
 
113 113
         # Alias for FactoryGirl.build_stubbed.
114 114
         def self.stub(name, overrides = {})
115  
-          ActiveSupport::Deprecation.warn "DEPRECATION WARNING: Factory.stub is deprecated; use FactoryGirl.build_stubbed instead.", caller
  115
+          ActiveSupport::Deprecation.warn "Factory.stub is deprecated; use FactoryGirl.build_stubbed instead.", caller
116 116
           FactoryGirl.build_stubbed(name, overrides)
117 117
         end
118 118
       end
@@ -122,7 +122,7 @@ def self.stub(name, overrides = {})
122 122
       # Example:
123 123
       #   Factory(:user, name: 'Joe')
124 124
       def Factory(name, attrs = {})
125  
-        ActiveSupport::Deprecation.warn "DEPRECATION WARNING: Factory(:name) is deprecated; use FactoryGirl.create(:name) instead.", caller
  125
+        ActiveSupport::Deprecation.warn "Factory(:name) is deprecated; use FactoryGirl.create(:name) instead.", caller
126 126
         FactoryGirl.create(name, attrs)
127 127
       end
128 128
     end

0 notes on commit 28e3c25

Please sign in to comment.
Something went wrong with that request. Please try again.