{"action":"created","issue":{"url":"https://api.github.com/repos/Olivine-Labs/busted/issues/433","labels_url":"https://api.github.com/repos/Olivine-Labs/busted/issues/433/labels{/name}","comments_url":"https://api.github.com/repos/Olivine-Labs/busted/issues/433/comments","events_url":"https://api.github.com/repos/Olivine-Labs/busted/issues/433/events","html_url":"https://github.com/Olivine-Labs/busted/issues/433","id":89335396,"number":433,"title":"require isolation part 2?","user":{"login":"karlp","id":127907,"avatar_url":"https://avatars.githubusercontent.com/u/127907?v=3","gravatar_id":"","url":"https://api.github.com/users/karlp","html_url":"https://github.com/karlp","followers_url":"https://api.github.com/users/karlp/followers","following_url":"https://api.github.com/users/karlp/following{/other_user}","gists_url":"https://api.github.com/users/karlp/gists{/gist_id}","starred_url":"https://api.github.com/users/karlp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karlp/subscriptions","organizations_url":"https://api.github.com/users/karlp/orgs","repos_url":"https://api.github.com/users/karlp/repos","events_url":"https://api.github.com/users/karlp/events{/privacy}","received_events_url":"https://api.github.com/users/karlp/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-18T16:22:06Z","updated_at":"2015-06-19T12:14:57Z","closed_at":null,"body":"I had originally filed https://github.com/Olivine-Labs/busted/issues/62 and got workaroudns with \r\n\r\n```lua\r\nmy_uci = require(\"uci\")\r\nmy_uci.set_confdir(blah)\r\npackage.preload['uci'] = function() return my_uci end\r\n```\r\n\r\nAll well and good.  I'm now using busted 2.0rc9 and it doesn't work anymore, depending on the order of execution I get a different version of the uci module loaded.  No amount of playing with isolate/expose has helped.  I've tried to replace the UCI module with a stub to demonstrate the issue, but however I've made my stub doesn't exhibit the same behaviour.\r\n\r\nHow is one _meant_ to reconfigure a module that the code under test will require()?  I can't (won't) change the code under test\r\n\r\nI've put a sample project, fwiw, at https://github.com/karlp/busted-busted-isolation\r\n"},"comment":{"url":"https://api.github.com/repos/Olivine-Labs/busted/issues/comments/113496354","html_url":"https://github.com/Olivine-Labs/busted/issues/433#issuecomment-113496354","issue_url":"https://api.github.com/repos/Olivine-Labs/busted/issues/433","id":113496354,"user":{"login":"karlp","id":127907,"avatar_url":"https://avatars.githubusercontent.com/u/127907?v=3","gravatar_id":"","url":"https://api.github.com/users/karlp","html_url":"https://github.com/karlp","followers_url":"https://api.github.com/users/karlp/followers","following_url":"https://api.github.com/users/karlp/following{/other_user}","gists_url":"https://api.github.com/users/karlp/gists{/gist_id}","starred_url":"https://api.github.com/users/karlp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karlp/subscriptions","organizations_url":"https://api.github.com/users/karlp/orgs","repos_url":"https://api.github.com/users/karlp/repos","events_url":"https://api.github.com/users/karlp/events{/privacy}","received_events_url":"https://api.github.com/users/karlp/received_events","type":"User","site_admin":false},"created_at":"2015-06-19T12:14:57Z","updated_at":"2015-06-19T12:14:57Z","body":"I'd say I probably _want_ isolation, and the old preload hacking was to work around when someone (possibly me, way back then) worked out that the uci library (yes, it is a lua binding to a C library) didn't like being reloaded. \r\n\r\nIf I try to \"expose\" the require of uci, how can I control that it is first?  I guess I should use something like the helpers here https://github.com/jszakmeister/neovim/commit/3605edca0d8618a8f3fba211d5485608c1cd39c2 and have those set the directory?\r\n\r\nI think I'll just toss the tests honestly, it's been a massive time sink and updating has just sucked in more time."}}