Sha256: a5e6450ebbb0407ddea9eaec8c16ace067b8f7ba664217d2e221203b8cf80da9

Contents?: true

Size: 676 Bytes

Versions: 27

Compression:

Stored size: 676 Bytes

Contents

class Factory

  # Raised when defining an invalid attribute:
  # * Defining an attribute which has a name ending in "="
  # * Defining an attribute with both a static and lazy value
  # * Defining an attribute twice in the same factory
  class AttributeDefinitionError < RuntimeError
  end
  
  class Attribute #:nodoc:

    attr_reader :name

    def initialize(name)
      @name = name.to_sym

      if @name.to_s =~ /=$/
        attribute_name = $`
        raise AttributeDefinitionError, 
          "factory_girl uses 'f.#{attribute_name} value' syntax " +
          "rather than 'f.#{attribute_name} = value'"
      end
    end

    def add_to(proxy)
    end
  end

end

Version data entries

27 entries across 27 versions & 14 rubygems

Version Path
BrettRasmussen-factory_girl-1.2.2 lib/factory_girl/attribute.rb
BrettRasmussen-factory_girl-1.2.3 lib/factory_girl/attribute.rb
agibralter-factory_girl-1.2.1 lib/factory_girl/attribute.rb
lacomartincik-factory_girl-1.2.1.1 lib/factory_girl/attribute.rb
masa-iwasaki-factory_girl-1.2.1.1 lib/factory_girl/attribute.rb
qrush-factory_girl-1.2.1.1 lib/factory_girl/attribute.rb
thoughtbot-factory_girl-1.2.2 lib/factory_girl/attribute.rb
ttilley-factory_girl-1.2.2.1 lib/factory_girl/attribute.rb
ttilley-factory_girl-1.2.2.2 lib/factory_girl/attribute.rb
ttilley-factory_girl-1.2.2 lib/factory_girl/attribute.rb
vitalish-factory_girl-1.2.10 lib/factory_girl/attribute.rb
vitalish-factory_girl-1.2.9 lib/factory_girl/attribute.rb
vitalish-factory_girl-1.2.8 lib/factory_girl/attribute.rb
vitalish-factory_girl-1.2.7 lib/factory_girl/attribute.rb
vitalish-factory_girl-1.2.6 lib/factory_girl/attribute.rb
lockbox_middleware-1.2.1 vendor/gems/factory_girl-1.2.3/lib/factory_girl/attribute.rb
malvestuto_factory_girl-1.2.5 lib/factory_girl/attribute.rb
factory_girl-1.2.4 lib/factory_girl/attribute.rb
jeffrafter-factory_girl-1.2.3 lib/factory_girl/attribute.rb
masa-iwasaki-factory_girl-1.2.3.2 lib/factory_girl/attribute.rb