Commit Graph

10 Commits

Author SHA1 Message Date
Jeremiah Russell
15599e2258 🧹 Refactor: add run_init_basic helper to eliminate command duplication 2025-10-23 11:16:25 +01:00
Jeremiah Russell
4550ffca92 🧹 Refactor: eliminate test duplication with helper functions 2025-10-23 11:16:25 +01:00
Jeremiah Russell
cc8259bd6a Add integration tests for --skip-rules 2025-10-23 11:16:25 +01:00
Jeremiah Russell
4283adf7b2 ♻️ Refactor duplicated test setup in integration tests
Extract repeated test command setup into helper functions:
- run_init_with_dirs() for tests with separate config/rules directories
- run_init_with_credential() for tests with credential files

This eliminates code duplication and makes tests more maintainable.
Also fixed duplicate #[test] attribute warning.
2025-10-22 06:38:00 +01:00
Jeremiah Russell
d4cc2621db Add configurable rules directory support
- Add rules configuration option to ClientConfig
- Support custom rules file paths via config and CLI
- Add --rules-dir option to init command
- Update Rules struct to accept custom file paths
- Add helper functions for rules path resolution
- Fix doc comment formatting issues
- Add integration tests for custom rules paths
2025-10-22 06:38:00 +01:00
Jeremiah Russell
e914e492e8 test: add integration tests for --rules-dir feature
- Add test_init_with_separate_rules_directory to verify rules created in custom location
- Add test_init_rules_dir_dry_run to verify dry-run behavior with --rules-dir
- Verify config file contains correct rules path when using separate directory
- All 12 init integration tests passing (11 run, 1 ignored)
2025-10-22 06:38:00 +01:00
Jeremiah Russell
df9d2b6c8a 🔧 fix: address clippy warnings after refactoring
- Change &PathBuf to &Path parameter in plan_credential_file_operation
- Use inline format string in log message
- Both formatting and linting now clean
2025-10-21 14:48:31 +01:00
Jeremiah Russell
fc9a1418b9 ♻️ refactor: extract mock credential file creation into helper function
- Add create_mock_credential_file() helper to eliminate duplication
- Replace identical credential JSON creation in two integration tests
- Improves test maintainability and reduces code duplication
- All tests continue to pass with same behavior
2025-10-21 14:48:31 +01:00
Jeremiah Russell
8f79081b4f 🔧 fix: address clippy warnings and improve code formatting 2025-10-21 14:48:31 +01:00
Jeremiah Russell
2cfd16c8ac 🧪 test(init): unit tests for planning and file IO 2025-10-21 14:48:31 +01:00