Skip to content

Commit ae47200

Browse files
committed
Convert RAILS_ROOT to a Pathname
1 parent 58e57d1 commit ae47200

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

spec/support/generator_setup.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
module GeneratorSetup
2-
RAILS_ROOT = File.expand_path("../../../tmp/dummy", __dir__)
2+
RAILS_ROOT = Pathname.new(File.expand_path("../../../tmp/dummy", __dir__)).freeze
33
MIGRATION_TIMESTAMP_PATTERN = /\d+_/
44

55
def run_generator(generator_class, args = [], options = {})
6-
allow(Rails).to receive(:root).and_return(Pathname.new(RAILS_ROOT))
6+
allow(Rails).to receive(:root).and_return(RAILS_ROOT)
77
generator = generator_class.new(args, options, destination_root: RAILS_ROOT)
88

99
silence_stream($stdout) do
@@ -12,7 +12,7 @@ def run_generator(generator_class, args = [], options = {})
1212
end
1313

1414
def file(relative_path)
15-
Pathname.new(File.join(RAILS_ROOT, relative_path))
15+
RAILS_ROOT.join(relative_path)
1616
end
1717

1818
def migration_content(file_path)

0 commit comments

Comments
 (0)