Sha256: e3ec7fd62cb7757c9a90beb61e4f050fce75120654f0a743242b11087f7afd1a

Contents?: true

Size: 284 Bytes

Versions: 3

Compression:

Stored size: 284 Bytes

Contents

require "tmpdir"
require "rspec"
require "pathname"

RSpec.shared_context "uses temp dir" do
  around do |example|
    Dir.mktmpdir("rspec-") do |dir|
      @temp_dir = dir
      example.run
    end
  end

  attr_reader :temp_dir

  def temp_dir_path
    Pathname(temp_dir)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rspec-temp_dir-1.1.1 lib/rspec/temp_dir/uses_temp_dir.rb
rspec-temp_dir-1.1.0 lib/rspec/temp_dir/uses_temp_dir.rb
rspec-temp_dir-1.0.0 lib/rspec/temp_dir/uses_temp_dir.rb