diff --git a/VERSION b/VERSION index 5e57fb8..83cf0d9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.29.0 +1.29.1 diff --git a/tests/Clean.Tests.ps1 b/tests/Clean.Tests.ps1 index ac625a2..4c6dbb3 100644 --- a/tests/Clean.Tests.ps1 +++ b/tests/Clean.Tests.ps1 @@ -107,6 +107,12 @@ Describe "Developer Tools Cleanup Module" { Get-Command Clear-GoCaches -ErrorAction SilentlyContinue | Should -Not -BeNullOrEmpty } } + + Context "mise Cleanup" { + It "Should have mise cache cleanup function" { + Get-Command Clear-MiseCache -ErrorAction SilentlyContinue | Should -Not -BeNullOrEmpty + } + } Context "Rust Cleanup" { It "Should have Rust cache cleanup function" { diff --git a/tests/Commands.Tests.ps1 b/tests/Commands.Tests.ps1 index 58b8dde..618aa3b 100644 --- a/tests/Commands.Tests.ps1 +++ b/tests/Commands.Tests.ps1 @@ -5,6 +5,7 @@ BeforeAll { # Get the windows directory path (tests are in windows/tests/) $script:WindowsDir = Split-Path -Parent $PSScriptRoot $script:BinDir = Join-Path $script:WindowsDir "bin" + $script:InstallScript = Join-Path $script:WindowsDir "install.ps1" } Describe "Clean Command" { @@ -177,3 +178,41 @@ Describe "Main Entry Point" { } } } + +Describe "Installer Script" { + Context "Version Source" { + It "Should read the version from VERSION" { + $source = Get-Content $script:InstallScript -Raw + $source | Should -Match "version\.ps1" + $source | Should -Match "Get-MoleVersionString -RootDir \$script:SourceDir" + } + } + + Context "Optional TUI Tools" { + It "Should downgrade TUI setup errors to warnings" { + $source = Get-Content $script:InstallScript -Raw + $source | Should -Match "Ensure-TuiBinary" + $source | Should -Match "Skipping .*non-fatal setup error" + $source | Should -Match "Could not prepare .*Install Go or wait for a Windows prerelease asset" + } + } +} + +Describe "Source Install Hygiene" { + Context ".gitattributes" { + It "Should normalize tracked line endings for Windows source installs" { + $source = Get-Content (Join-Path $script:WindowsDir ".gitattributes") -Raw + $source | Should -Match '\* text=auto eol=lf' + $source | Should -Match '\*\.ps1 text eol=lf' + $source | Should -Match '\*\.cmd text eol=crlf' + } + } + + Context ".gitignore" { + It "Should ignore generated launcher batch files" { + $source = Get-Content (Join-Path $script:WindowsDir ".gitignore") -Raw + $source | Should -Match '(?m)^mole\.cmd$' + $source | Should -Match '(?m)^mo\.cmd$' + } + } +} diff --git a/tests/Core.Tests.ps1 b/tests/Core.Tests.ps1 index 1eebc31..937b6f3 100644 --- a/tests/Core.Tests.ps1 +++ b/tests/Core.Tests.ps1 @@ -5,12 +5,15 @@ BeforeAll { # Get the windows directory path (tests are in windows/tests/) $script:WindowsDir = Split-Path -Parent $PSScriptRoot $script:LibDir = Join-Path $script:WindowsDir "lib" + $script:VersionFile = Join-Path $script:WindowsDir "VERSION" # Import core modules . "$script:LibDir\core\base.ps1" . "$script:LibDir\core\log.ps1" . "$script:LibDir\core\ui.ps1" . "$script:LibDir\core\file_ops.ps1" + . "$script:LibDir\core\version.ps1" + . "$script:LibDir\core\tui_binaries.ps1" } Describe "Base Module" { @@ -240,3 +243,17 @@ Describe "UI Module" { } } } + +Describe "Version Helpers" { + Context "Shared VERSION Source" { + It "Should read the version from VERSION" { + $expected = (Get-Content $script:VersionFile -Raw).Trim() + Get-MoleVersionString -RootDir $script:WindowsDir | Should -Be $expected + } + + It "Should keep TUI release lookup aligned with VERSION" { + $expected = (Get-Content $script:VersionFile -Raw).Trim() + Get-MoleVersionFromScriptFile -WindowsDir $script:WindowsDir | Should -Be $expected + } + } +}