Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add testPath and mainPath #54

Open
AndreaLaGrotteria opened this issue Jan 13, 2025 · 0 comments
Open

add testPath and mainPath #54

AndreaLaGrotteria opened this issue Jan 13, 2025 · 0 comments
Assignees

Comments

@AndreaLaGrotteria
Copy link
Collaborator

AndreaLaGrotteria commented Jan 13, 2025

Feature description

Temporarily removed, to add back

    /**
     * Generates the main path for a given application name, file name, option, and configuration.
     *
     * @param app           the application
     * @param fileName      the name of the file
     * @param option        the GuidesOption to consider
     * @param configuration the GuidesConfiguration to use
     * @return the generated main path
     */
    @NonNull
    static String mainPath(@NonNull App app,
                           @NonNull String fileName,
                           @NonNull GuidesOption option,
                           @NonNull GuidesConfiguration configuration) {
        return pathByFolder(app, fileName, "main", option);
    }

    /**
     * Generates the test path for a given application name, file name, option, and configuration.
     *
     * @param app           the application
     * @param name          the name of the file
     * @param option        the GuidesOption to consider
     * @param configuration the GuidesConfiguration to use
     * @return the generated test path
     */
    @NonNull
    static String testPath(@NonNull App app,
                           @NonNull String name,
                           @NonNull GuidesOption option,
                           @NonNull GuidesConfiguration configuration) {
        String fileName = name;
        if (option.getTestFramework() != null) {
            if (name.endsWith("Test")) {
                fileName = name.substring(0, name.indexOf("Test"));
                fileName += option.getTestFramework() == SPOCK ? "Spec" : "Test";
            }
        }

        return pathByFolder(app, fileName, "test", option);
    }
@AndreaLaGrotteria AndreaLaGrotteria self-assigned this Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant