Skip to content

Commit

Permalink
Require each file separately -- to make sure they aren't accidentally…
Browse files Browse the repository at this point in the history
… making each other pass
  • Loading branch information
rmosolgo committed Dec 9, 2024
1 parent 82402a9 commit 83572b0
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions spec/graphql/autoload_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,12 @@ def self.eager_load!
describe "loading nested files in the repo" do
it "can load them individually" do
files_to_load = Dir.glob("lib/**/tracing/*.rb")
require_script = "".dup
assert_equal 24, files_to_load.size, "It found all the expected files"
files_to_load.each do |file|
require_path = file.sub("lib/", "").sub(".rb", "")
require_script << "require \"#{require_path}\";\n"
stderr_and_stdout, _status = Open3.capture2e("ruby -Ilib -e 'require \"#{require_path}\"'")
assert_equal "", stderr_and_stdout, "It loads #{require_path.inspect} in isolation"
end
stderr_and_stdout, _status = Open3.capture2e("ruby -Ilib -e '#{require_script}'")
assert_equal 24, files_to_load.size, "It found all the expected files"
assert_equal "", stderr_and_stdout
end
end
end

0 comments on commit 83572b0

Please sign in to comment.