diff --git a/spec/graphql/autoload_spec.rb b/spec/graphql/autoload_spec.rb index ba9e4e490e..a64620bd8f 100644 --- a/spec/graphql/autoload_spec.rb +++ b/spec/graphql/autoload_spec.rb @@ -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