Sha256: ed456507e6d8569aa12b6b21858863c527288d7d6382ca2c91b89165c9f7613e

Contents?: true

Size: 979 Bytes

Versions: 11

Compression:

Stored size: 979 Bytes

Contents

require 'rspec_ext'
require 'ruby_ext'

require 'tilt'
require 'vfs'

rspec do
  def self.with_test_dir
    before do
      @test_dir = "/tmp/test_dir".to_dir

      FileUtils.rm_r test_dir.path if File.exist? test_dir.path
      FileUtils.mkdir_p test_dir.path
    end

    after do
      FileUtils.rm_r test_dir.path if File.exist? test_dir.path
      @test_dir = nil
    end
  end

  def test_dir
    @test_dir
  end
end

# require 'fakefs/spec_helpers'
#
# include FakeFS::SpecHelpers
# use_fakefs self
#
#
# #
# # FakeFS fixes
# #
# FakeFS::File::Stat.class_eval do
#   # there's also file? method defined on File::Stat
#   def file?; !directory? end
# end
#
# FakeFS::File.class_eval do
#   class << self
#     # File.delete should raise error if it's directory
#     alias_method :delete_without_bang, :delete
#     def delete path
#       raise Errno::EPERM, "Operation not permitted - #{path}" if directory?(path)
#       delete_without_bang path
#     end
#   end
# end

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
vfs-momolog-0.0.1 spec/spec_helper.rb
vfs-0.4.8 spec/spec_helper.rb
vfs-0.4.7 spec/spec_helper.rb
vfs-0.4.6 spec/spec_helper.rb
vfs-0.4.5 spec/spec_helper.rb
vfs-0.4.4 spec/spec_helper.rb
vfs-0.4.3 spec/spec_helper.rb
vfs-0.4.2 spec/spec_helper.rb
vfs-0.4.1 spec/spec_helper.rb
vfs-0.4.0 spec/spec_helper.rb
io-0.0.1 spec/spec_helper.rb