Sha256: 6fb23e0a9e96475d406223c904eabd5a3979f13d92e5acdeeb702a373c522e7c

Contents?: true

Size: 673 Bytes

Versions: 4

Compression:

Stored size: 673 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

4 entries across 4 versions & 1 rubygems

Version Path
factory_girl-1.3.3 lib/factory_girl/attribute.rb
factory_girl-1.3.2 lib/factory_girl/attribute.rb
factory_girl-1.3.1 lib/factory_girl/attribute.rb
factory_girl-1.3.0 lib/factory_girl/attribute.rb