From b60f03082448898e0be14ca7c0c908d9ce7aa905 Mon Sep 17 00:00:00 2001 From: Glenn Date: Fri, 5 Jan 2024 11:48:12 +0100 Subject: [PATCH] fix: make unit tests work with CODE_PRELOADER_DETECT=no --- spec/config_data/complex_config.yml | 11 ++++++----- spec/config_data/simple_config.yml | 11 ++++++----- spec/config_spec.cr | 12 ++++++------ spec/spec_helper.cr | 3 ++- 4 files changed, 20 insertions(+), 17 deletions(-) diff --git a/spec/config_data/complex_config.yml b/spec/config_data/complex_config.yml index 924af8f..65b88ff 100644 --- a/spec/config_data/complex_config.yml +++ b/spec/config_data/complex_config.yml @@ -12,10 +12,11 @@ ignore_list: - complex/ignore2 # Path to the output file (if null, output to STDOUT) -output_file_path: complex_output.txt +output_path: complex_output.txt -# Optional: Path to a file containing the header prompt -header_prompt_file_path: null +prompt: + # Optional: Path to a file containing the header prompt + header_path: null -# Optional: Path to a file containing the footer prompt -footer_prompt_file_path: null + # Optional: Path to a file containing the footer prompt + footer_path: null diff --git a/spec/config_data/simple_config.yml b/spec/config_data/simple_config.yml index 793b6fa..0460b8f 100644 --- a/spec/config_data/simple_config.yml +++ b/spec/config_data/simple_config.yml @@ -11,10 +11,11 @@ ignore_list: - simple/ignore # Path to the output file (if null, output to STDOUT) -output_file_path: simple_output.txt +output_path: simple_output.txt -# Optional: Path to a file containing the header prompt -header_prompt_file_path: null +prompt: + # Optional: Path to a file containing the header prompt + header_path: null -# Optional: Path to a file containing the footer prompt -footer_prompt_file_path: null + # Optional: Path to a file containing the footer prompt + footer_path: null diff --git a/spec/config_spec.cr b/spec/config_spec.cr index a48e825..782cb6e 100644 --- a/spec/config_spec.cr +++ b/spec/config_spec.cr @@ -50,7 +50,7 @@ describe CodePreloader::Config do config.subcommand.should eq(Config::Subcommand::Pack) config.pack_options.should be_truthy config.pack_options.try do |opts| - opts.repository_path_list.should eq ["path/to/repo1", "path/to/repo2"] + opts.source_list.should eq ["path/to/repo1", "path/to/repo2"] end end @@ -72,7 +72,7 @@ describe CodePreloader::Config do config.subcommand.should eq(Config::Subcommand::Pack) config.pack_options.should be_truthy config.pack_options.try do |opts| - opts.output_file_path.should eq "output.txt" + opts.output_path.should eq "output.txt" end end @@ -88,9 +88,9 @@ describe CodePreloader::Config do # Assuming the simple_config.yml has specific settings config.pack_options.should be_truthy config.pack_options.try do |opts| - opts.repository_path_list.should eq ["path/to/repo"] + opts.source_list.should eq ["path/to/repo"] opts.ignore_list.should eq ["simple/ignore"] - opts.output_file_path.should eq "simple_output.txt" + opts.output_path.should eq "simple_output.txt" end end @@ -103,9 +103,9 @@ describe CodePreloader::Config do # Assuming the complex_config.yml has specific settings config.pack_options.should be_truthy config.pack_options.try do |opts| - opts.repository_path_list.should eq [repo_path] + opts.source_list.should eq [repo_path] opts.ignore_list.should eq ["complex/ignore1", "complex/ignore2"] - opts.output_file_path.should eq "complex_output.txt" + opts.output_path.should eq "complex_output.txt" end end diff --git a/spec/spec_helper.cr b/spec/spec_helper.cr index 13c6efb..a029838 100644 --- a/spec/spec_helper.cr +++ b/spec/spec_helper.cr @@ -1,4 +1,5 @@ require "spec" -# require "../src/" +ENV["CODE_PRELOADER_DETECT"] = "no" +