{"action":"closed","issue":{"url":"https://api.github.com/repos/yeoman/generator/issues/742","labels_url":"https://api.github.com/repos/yeoman/generator/issues/742/labels{/name}","comments_url":"https://api.github.com/repos/yeoman/generator/issues/742/comments","events_url":"https://api.github.com/repos/yeoman/generator/issues/742/events","html_url":"https://github.com/yeoman/generator/issues/742","id":54887040,"number":742,"title":"withLocalConfig() method for RunContext","user":{"login":"gruppjo","id":1370779,"avatar_url":"https://avatars.githubusercontent.com/u/1370779?v=3","gravatar_id":"","url":"https://api.github.com/users/gruppjo","html_url":"https://github.com/gruppjo","followers_url":"https://api.github.com/users/gruppjo/followers","following_url":"https://api.github.com/users/gruppjo/following{/other_user}","gists_url":"https://api.github.com/users/gruppjo/gists{/gist_id}","starred_url":"https://api.github.com/users/gruppjo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gruppjo/subscriptions","organizations_url":"https://api.github.com/users/gruppjo/orgs","repos_url":"https://api.github.com/users/gruppjo/repos","events_url":"https://api.github.com/users/gruppjo/events{/privacy}","received_events_url":"https://api.github.com/users/gruppjo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/yeoman/generator/labels/actionnable","name":"actionnable","color":"009800"},{"url":"https://api.github.com/repos/yeoman/generator/labels/feature","name":"feature","color":"207de5"},{"url":"https://api.github.com/repos/yeoman/generator/labels/medium","name":"medium","color":"fef2c0"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-01-20T14:11:53Z","updated_at":"2015-02-16T20:18:15Z","closed_at":"2015-02-16T20:18:15Z","body":"I followed the discussion on issue #718 and have a suggestion to make, since I have a similar problem:\r\n\r\nAfter generating the project with the main generator, some of the sub-generators depend on choices the users made while running the main generator. E.g. the project's module name is `myModule`. Later when generating controllers, views, etc... in the project using the sub-generators, the sub-generators need to know they're creating a component for `myModule`.\r\n\r\nSo naturally you would write the following in the main generator:\r\n```\r\nthis.config.set('moduleName', userInput);\r\n```\r\nAnd the counterpart in the sub-generator:\r\n```\r\nthis.moduleName = this.config.get('moduleName');\r\n```\r\n\r\nUnfortunately, as far as I know, this cannot be tested, since the tests always start in a fresh directory. Obviously this results in errors when testing sub-generators independently.\r\n\r\nHowever if there was a possibility to provide the `.yo-rc.json` contents to the run context, it would be possible to run your tests independently in a decoupled fashion but also make adjustments based on previous choices the user made.\r\n\r\nWhat do you think?"}}