test/mock/dummy_class.rb in rubyless-0.1.0 vs test/mock/dummy_class.rb in rubyless-0.2.0
- old
+ new
@@ -1,16 +1,20 @@
-class Dummy
+require File.dirname(__FILE__) + '/active_record_mock'
+
+class Dummy < RubyLess::ActiveRecordMock
attr_reader :name
include RubyLess::SafeClass
safe_method [:ancestor?, Dummy] => RubyLess::Boolean
- safe_method :parent => {:class => 'Dummy', :special_option => 'foobar'}
- safe_method :children => ['Dummy']
- safe_method :project => 'Dummy'
- safe_method :spouse => {:class => 'Dummy', :nil => true}
- safe_method :husband => {:class => 'Dummy', :nil => true}
- safe_method :id => {:class => RubyLess::Number, :method => :zip}
- safe_method :name => String
+ safe_method :parent => {:class => 'Dummy', :special_option => 'foobar'},
+ :children => ['Dummy'],
+ :project => 'Dummy',
+ :spouse => {:class => 'Dummy', :nil => true},
+ :husband => {:class => 'Dummy', :nil => true},
+ :id => {:class => RubyLess::Number, :method => :zip},
+ :name => String
+
+ safe_attribute :age, :friend_id, :log_at, :format
def initialize(name = 'dummy')
@name = name
end
\ No newline at end of file