Permalink
Browse files

Move spike spec into integration

  • Loading branch information...
1 parent 0139e64 commit 39722ca92ab024d29ef7d38e3b784c0e88597117 Markus Schirp committed Jun 8, 2012
@@ -3,6 +3,14 @@ module Mapper
class Attribute
# A mapper for a plain primitive object
class Object < Attribute
+ private
+ def initialize(load_name,options={})
+ @load_name = load_name
+ @dump_name = options.fetch(:to,load_name)
+ end
+
+ public
+
def loader_method_source
<<-RUBY
def #{@load_name}
@@ -27,11 +35,6 @@ def dump_names
[@dump_name]
end
- def initialize(load_name,options={})
- @load_name = load_name
- @dump_name = options.fetch(:to,load_name)
- end
-
def define_loader(klass)
klass.class_eval(loader_method_source,__FILE__,__LINE__+1)
end
@@ -46,8 +46,6 @@ def map(*args)
self
end
- private
-
def const_missing(name)
Attribute.determine_type(name) || super
end
File renamed without changes.
@@ -13,7 +13,7 @@
it 'should define method on dumper klass with correct ruby' do
dumper_klass.
should_receive(:class_eval).
- with(object.dumper_method_source,"/home/mbj/devel/mapper/lib/mapper/attribute/object.rb",41)
+ with(object.dumper_method_source,"/home/mbj/devel/mapper/lib/mapper/attribute/object.rb",44)
subject
end
@@ -13,7 +13,7 @@
it 'should define method on dumper klass with correct ruby' do
dumper_klass.
should_receive(:class_eval).
- with(object.loader_method_source,"/home/mbj/devel/mapper/lib/mapper/attribute/object.rb",37)
+ with(object.loader_method_source,"/home/mbj/devel/mapper/lib/mapper/attribute/object.rb",40)
subject
end

0 comments on commit 39722ca

Please sign in to comment.