Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit bc1c4ab

Browse files
author
Sam Phippen
committed
Merge pull request #1565 from rspec/remove-fileutils
Remove fileutils
2 parents 55843a2 + 1df5f03 commit bc1c4ab

File tree

5 files changed

+11
-14
lines changed

5 files changed

+11
-14
lines changed

Changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ Enhancements:
77
in commented out section of `spec_helper` rather than `.rspec` so users
88
have to consciously opt-in to the setting. (Andrew Hooker, #1572)
99

10+
Bug Fixes:
11+
12+
* Remove dependency on `FileUtils` from the standard library so that users do
13+
not get false positives where their code relies on it but they are not
14+
requiring it. (Sam Phippen, #1565)
15+
1016
### 3.0.1 Development
1117
[Full Changelog](http://github.com/rspec/rspec-core/compare/v3.0.0...3-0-maintenance)
1218

lib/rspec/core/configuration.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
require 'fileutils'
2-
31
RSpec::Support.require_rspec_core "backtrace_formatter"
42
RSpec::Support.require_rspec_core "ruby_project"
53
RSpec::Support.require_rspec_core "formatters/deprecation_formatter"

lib/rspec/core/formatters.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
RSpec::Support.require_rspec_support "directory_maker"
12
# ## Built-in Formatters
23
#
34
# * progress (default) - prints dots for passing examples, `F` for failures, `*` for pending
@@ -232,7 +233,7 @@ def underscore(camel_cased_word)
232233
end
233234

234235
def file_at(path)
235-
FileUtils.mkdir_p(File.dirname(path))
236+
RSpec::Support::DirectoryMaker.mkdir_p(File.dirname(path))
236237
File.new(path, 'w')
237238
end
238239
end

lib/rspec/core/project_initializer.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
RSpec::Support.require_rspec_support "directory_maker"
2+
13
module RSpec
24
module Core
35
# @private
@@ -28,7 +30,7 @@ def copy_template(file)
2830
return report_exists(file) if File.exist?(destination_file)
2931

3032
report_creating(file)
31-
FileUtils.mkdir_p(File.dirname(destination_file))
33+
RSpec::Support::DirectoryMaker.mkdir_p(File.dirname(destination_file))
3234
File.open(destination_file, 'w') do |f|
3335
f.write File.read(File.join(template_path, file))
3436
end

spec/support/isolated_directory.rb

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)