{"action":"closed","issue":{"url":"https://api.github.com/repos/reem/stainless/issues/68","repository_url":"https://api.github.com/repos/reem/stainless","labels_url":"https://api.github.com/repos/reem/stainless/issues/68/labels{/name}","comments_url":"https://api.github.com/repos/reem/stainless/issues/68/comments","events_url":"https://api.github.com/repos/reem/stainless/issues/68/events","html_url":"https://github.com/reem/stainless/issues/68","id":180774218,"number":68,"title":"Getting the test name","user":{"login":"ysimonson","id":127386,"avatar_url":"https://avatars.githubusercontent.com/u/127386?v=3","gravatar_id":"","url":"https://api.github.com/users/ysimonson","html_url":"https://github.com/ysimonson","followers_url":"https://api.github.com/users/ysimonson/followers","following_url":"https://api.github.com/users/ysimonson/following{/other_user}","gists_url":"https://api.github.com/users/ysimonson/gists{/gist_id}","starred_url":"https://api.github.com/users/ysimonson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ysimonson/subscriptions","organizations_url":"https://api.github.com/users/ysimonson/orgs","repos_url":"https://api.github.com/users/ysimonson/repos","events_url":"https://api.github.com/users/ysimonson/events{/privacy}","received_events_url":"https://api.github.com/users/ysimonson/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-10-03T23:40:23Z","updated_at":"2016-10-04T10:59:52Z","closed_at":"2016-10-04T10:59:52Z","body":"I have a sandbox with a setup method that inserts sample data into a database. Because the tests may run concurrently, I want to isolate the sample data used for one test from another. To do so, I use the test name as part of the key for any data inserted into the database. As a result, I need to pass the test name into `sandbox.setup()` and consequently put the test name in twice, like so:\r\n\r\n```rust\r\ndescribe! foo {\r\n  before_each {\r\n    let mut sandbox = TestSandbox::new();\r\n  }\r\n\r\n  after_each {\r\n    sandbox.teardown();\r\n  }\r\n\r\n  it \"should allow you to do foo\" {\r\n    sandbox.setup(\"should allow you to do foo\");\r\n    do_foo(&mut sandbox)\r\n  }\r\n}\r\n```\r\n\r\nIs there a cleaner way to do this, i.e. a macro or something I could use such that I don't need to pass the test name into `sandbox.setup()`?\r\n"}}
{"actor":{"display_login":"ysimonson"}}