@@ -21,19 +21,8 @@ def create_pom(group_id, artifact_id, version, license_name)
2121 XML
2222 end
2323
24- let ( :test_cases ) do
25- {
26- "The Apache Software License, Version 2.0" => "Apache-2.0" ,
27- "The MIT License" => "MIT" ,
28- "Eclipse Public License 1.0" => "EPL-1.0" ,
29- "GNU General Public License, version 2" => "GPL-2.0-only" ,
30- "GNU Lesser General Public License" => "LGPL-2.1-only" ,
31- "Unmapped Custom License" => "Unmapped Custom License"
32- }
33- end
34-
35- it "detects license names and converts them to SPDX" do
36- test_cases . each do |raw_name , expected_spdx |
24+ Tetra ::LICENSE_MAPPINGS . each do |raw_name , expected_spdx |
25+ it "correctly maps '#{ raw_name } ' to '#{ expected_spdx } '" do
3726 project_name = "proj-#{ expected_spdx . downcase . gsub ( /[^a-z0-9]/ , "" ) } "
3827 version = "1.0"
3928 group_id = "com.example"
@@ -49,19 +38,19 @@ def create_pom(group_id, artifact_id, version, license_name)
4938 run_command_and_stop ( "tetra init #{ project_name } #{ tarball_name } " )
5039
5140 cd ( project_name ) do
41+ # NOTE: Identity is already set in spec_helper's around hook,
42+ # but we can keep these for explicit project-level config
5243 run_command_and_stop ( "git config user.email 'test@example.com'" )
5344 run_command_and_stop ( "git config user.name 'Test User'" )
5445
5546 # --- NON-INTERACTIVE DRY-RUN ---
56- # We use a heredoc to pipe the commands directly.
5747 run_command ( "tetra dry-run" )
5848 last_command_started . write <<~COMMANDS
5949 touch #{ project_name } -#{ version } .jar
6050 echo 'changes' >> README
6151 exit 0
6252 COMMANDS
6353
64- # Stop will wait for the pipe to close and the process to exit naturally
6554 last_command_started . stop
6655 expect ( last_command_started ) . to be_successfully_executed
6756
0 commit comments