{"action":"created","issue":{"url":"https://api.github.com/repos/crystal-lang/crystal/issues/5951","repository_url":"https://api.github.com/repos/crystal-lang/crystal","labels_url":"https://api.github.com/repos/crystal-lang/crystal/issues/5951/labels{/name}","comments_url":"https://api.github.com/repos/crystal-lang/crystal/issues/5951/comments","events_url":"https://api.github.com/repos/crystal-lang/crystal/issues/5951/events","html_url":"https://github.com/crystal-lang/crystal/pull/5951","id":314446107,"node_id":"MDExOlB1bGxSZXF1ZXN0MTgxNzE3MzIz","number":5951,"title":"Add tempfile and datapath helpers to specs","user":{"login":"straight-shoota","id":466378,"node_id":"MDQ6VXNlcjQ2NjM3OA==","avatar_url":"https://avatars0.githubusercontent.com/u/466378?v=4","gravatar_id":"","url":"https://api.github.com/users/straight-shoota","html_url":"https://github.com/straight-shoota","followers_url":"https://api.github.com/users/straight-shoota/followers","following_url":"https://api.github.com/users/straight-shoota/following{/other_user}","gists_url":"https://api.github.com/users/straight-shoota/gists{/gist_id}","starred_url":"https://api.github.com/users/straight-shoota/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/straight-shoota/subscriptions","organizations_url":"https://api.github.com/users/straight-shoota/orgs","repos_url":"https://api.github.com/users/straight-shoota/repos","events_url":"https://api.github.com/users/straight-shoota/events{/privacy}","received_events_url":"https://api.github.com/users/straight-shoota/received_events","type":"User","site_admin":false},"labels":[{"id":521914109,"node_id":"MDU6TGFiZWw1MjE5MTQxMDk=","url":"https://api.github.com/repos/crystal-lang/crystal/labels/kind:refactor","name":"kind:refactor","color":"c2e0c6","default":false},{"id":774699355,"node_id":"MDU6TGFiZWw3NzQ2OTkzNTU=","url":"https://api.github.com/repos/crystal-lang/crystal/labels/topic:specs","name":"topic:specs","color":"a4bbfc","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":26,"created_at":"2018-04-15T19:53:49Z","updated_at":"2018-06-14T11:19:36Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/crystal-lang/crystal/pulls/5951","html_url":"https://github.com/crystal-lang/crystal/pull/5951","diff_url":"https://github.com/crystal-lang/crystal/pull/5951.diff","patch_url":"https://github.com/crystal-lang/crystal/pull/5951.patch"},"body":"This PR introduces `with_tempfile` and `datapath` helpers to the stdlib spec suite.\r\n\r\n* `with_tempfile` receives a path and expands it relative to a temporary directory unique to every spec run. All temporary paths are prefixed by the name of the spec file that requests them. The constructed path is yielded and cleaned up after the block has returned. It can be used as file or directory path. The unique directory is removed at the end of the spec run (unless env var `SPEC_TEMPFILE_CLEANUP` is set to `0` - which can be useful for debugging).\r\n* `datapath` is used to create platform-independent paths to `spec/std/data` (or `spec/compiler/data` in the compiler spec).\r\n\r\nCloses #5811\r\n\r\nThis is work in progress. Feedback is still welcome.\r\n"},"comment":{"url":"https://api.github.com/repos/crystal-lang/crystal/issues/comments/397260188","html_url":"https://github.com/crystal-lang/crystal/pull/5951#issuecomment-397260188","issue_url":"https://api.github.com/repos/crystal-lang/crystal/issues/5951","id":397260188,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NzI2MDE4OA==","user":{"login":"RX14","id":2788811,"node_id":"MDQ6VXNlcjI3ODg4MTE=","avatar_url":"https://avatars0.githubusercontent.com/u/2788811?v=4","gravatar_id":"","url":"https://api.github.com/users/RX14","html_url":"https://github.com/RX14","followers_url":"https://api.github.com/users/RX14/followers","following_url":"https://api.github.com/users/RX14/following{/other_user}","gists_url":"https://api.github.com/users/RX14/gists{/gist_id}","starred_url":"https://api.github.com/users/RX14/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RX14/subscriptions","organizations_url":"https://api.github.com/users/RX14/orgs","repos_url":"https://api.github.com/users/RX14/repos","events_url":"https://api.github.com/users/RX14/events{/privacy}","received_events_url":"https://api.github.com/users/RX14/received_events","type":"User","site_admin":false},"created_at":"2018-06-14T11:19:36Z","updated_at":"2018-06-14T11:19:36Z","author_association":"MEMBER","body":"@jhass the problem is that on darwin `TMPDIR` is *always* set by the systems, and it's set to `/var/folders/ms/xg67k5sn16xc7sdr_w3q45840000gn/T/`. So the only fix is to ignore `TMPDIR`, which means we can't use `||=`."}}
{"actor":{"display_login":"RX14"}}