Sha256: 8c54434c69a96185cda24e04dae37e26e4416a05a453a724c30dd3fbc29a7a85

Contents?: true

Size: 363 Bytes

Versions: 7

Compression:

Stored size: 363 Bytes

Contents

RSpec.shared_context :temp_dir do
  before do
    @temp_dir = Dir.mktmpdir
    @current_dir = Dir.pwd
    Dir.chdir @temp_dir
  end
  
  after do
    Dir.chdir @current_dir
    FileUtils.rm_rf @temp_dir
  end
  
  def create_dummy_spec_files(*files)
    files.each do |file|
      FileUtils.mkdir_p File.dirname(file)
      FileUtils.touch file
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
opal-rspec-0.6.2 spec/mri/unit/opal/rspec/temp_dir_helper.rb
opal-rspec-0.6.1 spec/mri/unit/opal/rspec/temp_dir_helper.rb
opal-rspec-0.6.0 spec/mri/unit/opal/rspec/temp_dir_helper.rb
opal-rspec-0.6.0.beta1 spec/mri/unit/opal/rspec/temp_dir_helper.rb
opal-connect-rspec-0.5.0 spec/mri/unit/opal/rspec/temp_dir_helper.rb
opal-rspec-0.5.0 spec/mri/unit/opal/rspec/temp_dir_helper.rb
opal-rspec-0.5.0.beta3 spec/mri/unit/opal/rspec/temp_dir_helper.rb