iainbrighton / PScribo

PowerShell documentation framework
MIT License
231 stars 35 forks source link

PowerShell tests doesn't care about regional settings for a decimal separator #39

Closed it-praktyk closed 7 years ago

it-praktyk commented 7 years ago

If a decimal separator is not '.' (dot) but ',' (comma) than some Pester tests for PScribo fail due to hardcoded patern (?)

Tested with the current PScribo dev branch - the last commit a9b024eda4bccc0a84f3ba168f8bc21fcd5683c1 .

Describing OutHtml.Internal\GetHtmlTableStyle
   Context By Named Parameter.
    [-] creates default table style. 137ms
      String lengths are both 24. Strings differ at index 1.
      Expected: {0.08em 0.33em 0em 0.33em}
      But was:  {0,08em 0,33em 0em 0,33em}
      ------------^
      184:                 ($padding.Split(':').Trim())[1] | Should BeExactly '0.08em 0.33em 0em 0.33em';
      at <ScriptBlock>, C:\Users\<SOME_FOLDER>\PScribo\Tests\Plugins\OutHtml.Tests.ps1: line 184
    [-] creates custom table padding style of 5pt, 10pt, 5pt and 10pt. 64ms
      String lengths are both 27. Strings differ at index 1.
      Expected: {0.42em 0.83em 0.42em 0.83em}
      But was:  {0,42em 0,83em 0,42em 0,83em}
      ------------^
      200:                 ($padding.Split(':').Trim())[1] | Should BeExactly '0.42em 0.83em 0.42em 0.83em';
      at <ScriptBlock>, C:\Users\<SOME_FOLDER>\PScribo\Tests\Plugins\OutHtml.Tests.ps1: line 200
    [+] creates custom table border color style when -BorderWidth is specified. 63ms
    [-] creates custom table border width style of 3pt. 45ms
      String lengths are both 6. Strings differ at index 1.
      Expected: {0.25em}
      But was:  {0,25em}
      ------------^
      218:                 ($borderWidth.Split(':').Trim())[1] | Should BeExactly '0.25em';
      at <ScriptBlock>, C:\Users\<SOME_FOLDER>\PScribo\Tests\Plugins\OutHtml.Tests.ps1: line 218
    [+] creates custom table border with no color style when no -BorderWidth specified. 61ms
    [+] creates custom table border color style. 34ms
    [+] centers table. 34ms
    [+] aligns table to the right. 33ms

Probably helpful link: https://technet.microsoft.com/en-us/library/ff730954.aspx