• D
    Remove slashes and backslashes from image paths · 3c3b80eb
    Damir Zekić 提交于
    When a test method name includes a slash (e.g. `test "signup on the
    /signup page"`) the screenshot is generated in the nested directory on
    systems that use slash as a directory separator (e.g. a screenshot
    called `signup_page.png` is generated within `failures_signup_on_the_`).
    
    Nesting screenshots causes an issue with `tmp:clear` rake task:
    
    ```
    == Removing old logs and tempfiles ==
    rails aborted!
    Errno::EISDIR: Is a directory @ apply2files - tmp/screenshots/failures_signup_on_the_
    /var/lib/gems/2.5.0/gems/railties-5.2.3/lib/rails/tasks/tmp.rake:41:in `block (3 levels) in <top (required)>'
    /var/lib/gems/2.5.0/gems/railties-5.2.3/lib/rails/commands/rake/rake_command.rb:23:in `block in perform'
    ...
    Tasks: TOP => tmp:clear => tmp:screenshots:clear
    ```
    
    While the error could be prevented by changing `tmp:clear` task, there's
    no reason to generate deep directory structures for tests using slashes.
    
    To prevent a similar problem on Windows, we'll also "sanitize"
    backslashes.
    
    Replacing the problamatic characters with dashes seems to be a safe
    workaround, although dash is very arbitrary choice in this case.
    Co-Authored-By: NLouis-Michel Couture <louim_1@hotmail.com>
    3c3b80eb
可在Tags中查看这些版本中当前仓库的状态.
CHANGELOG.md 4.2 KB