Test/New-Package.Tests.ps1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
param ( [string] $PSScriptRoot = $( if ( $PSScriptRoot ) { $PSScriptRoot } else { Get-Location } ) ) . $PSScriptRoot\TestHelper.ps1 Describe 'New-Package' { Context 'Configured RScript' { BeforeAll { Set-RScriptPath -Path $RScriptPath $tempDirectory = ( Get-Item 'TestDrive:\' ).FullName $libPath = New-TempLibrary -TempDirectory $tempDirectory $project = New-TestProject -TempDirectory $tempDirectory -Library $libPath Install-RPackage -Name 'devtools' -Library $libPath } It 'throws on build without devtools' { { New-RPackage -Path $project } | Should -Throw } It 'builds package' { New-RPackage -Path $project -Library $libPath } } } |