Sha256: 37ed458650f6da109376e045eb89ec75eea2dfa34de651dbbcd83ea14d7d4f23

Contents?: true

Size: 494 Bytes

Versions: 4

Compression:

Stored size: 494 Bytes

Contents

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_test'.to_dir
  end

  class << self
    def with_file_model
      tmp = '/tmp/file_model_test'.to_dir

      before do
        tmp.destroy.create
        FileModel.box = Vos::Box.new(Vos::Drivers::Local.new(root: tmp.path))
      end

      after{tmp.destroy}
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
file_model-0.0.6 lib/file_model/spec.rb
file_model-0.0.5 lib/file_model/spec.rb
file_model-0.0.4 lib/file_model/spec.rb
file_model-0.0.3 lib/file_model/spec.rb