Sha256: b025906d3c6315e8e8619acd49529919d313507c86187b8590f7a555cd0916a6

Contents?: true

Size: 1.03 KB

Versions: 2

Compression:

Stored size: 1.03 KB

Contents

require 'eventmachine'
require 'em-fs'

SPEC_ROOT = File.expand_path(File.dirname(__FILE__))

EventMachine.instance_eval do
  def assertions time = 1
    EM.add_timer(time) do
      EM.stop_event_loop
      yield
    end
  end
end unless EM.respond_to?(:assertions)

unless File.exists?(File.join(SPEC_ROOT, 'data', 'test')) and
    File.exists?(File.join(SPEC_ROOT, 'data', 'test2')) and
    File.exists?(File.join(SPEC_ROOT, 'data', 'test3'))
  puts "Creating test dummy data"
  system "mkdir -p #{File.join(SPEC_ROOT, 'data')}"
  system "dd if=/dev/urandom of=#{File.join(SPEC_ROOT, 'data', 'test')} bs=1024 count=100"
  system "dd if=/dev/urandom of=#{File.join(SPEC_ROOT, 'data', 'test2')} bs=1024 count=100"
  system "dd if=/dev/urandom of=#{File.join(SPEC_ROOT, 'data', 'test3')} bs=1024 count=100"
end

# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
RSpec.configure do |config|
  config.treat_symbols_as_metadata_keys_with_true_values = true
  config.run_all_when_everything_filtered = true
  config.filter_run :focus
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
em-fs-0.1.0 spec/spec_helper.rb
em-fs-0.0.1 spec/spec_helper.rb