lib/file_model/spec.rb in file_model-0.0.2 vs lib/file_model/spec.rb in file_model-0.0.3
- old
+ new
@@ -1,25 +1,27 @@
require 'file_model'
require 'vos'
+FileModel::ClassMethods.class_eval do
+ def box; FileModel.box end
+end
+
+FileModel.metaclass_eval do
+ attr_accessor :box
+end
+
rspec do
def file_model_storage
- '/tmp/file_model'.to_dir
+ '/tmp/file_model_test'.to_dir
end
class << self
def with_file_model
- ::FileModel::ClassMethods.class_eval do
- def box
- ::FileModel.box
- end
- end
+ tmp = '/tmp/file_model_test'.to_dir
- tmp = '/tmp/file_model'.to_dir
-
before do
tmp.destroy.create
- FileModel.box = Vos::Box.new(Vos::Drivers::Local.new(tmp.path))
+ FileModel.box = Vos::Box.new(Vos::Drivers::Local.new(root: tmp.path))
end
after{tmp.destroy}
end
end
\ No newline at end of file