Sha256: 8f7ab1de1cfc4f0e845f1adcc135e656e6198f7f596227219642efdf396d2c2b
Contents?: true
Size: 1.22 KB
Versions: 132
Compression:
Stored size: 1.22 KB
Contents
# frozen_string_literal: true require 'eac_ruby_utils/fs/temp' RSpec.describe ::EacRubyUtils::Fs::Temp do describe '#on_file' do it do temp_path = nil described_class.on_file do |path| temp_path = path expect(temp_path).not_to exist temp_path.write('StubText') expect(temp_path).to exist end expect(temp_path).not_to exist end it 'not fail if already removed' do temp_path = nil described_class.on_file do |path| temp_path = path expect(temp_path).not_to exist temp_path.write('StubText') expect(temp_path).to exist temp_path.unlink end expect(temp_path).not_to exist end end describe '#on_directory' do it do temp_path = nil described_class.on_directory do |path| temp_path = path expect(temp_path).to be_directory end expect(temp_path).not_to exist end it 'not fail if already removed' do temp_path = nil described_class.on_directory do |path| temp_path = path expect(temp_path).to be_directory temp_path.rmtree expect(temp_path).not_to exist end expect(temp_path).not_to exist end end end
Version data entries
132 entries across 132 versions & 2 rubygems