{"action":"created","issue":{"url":"https://api.github.com/repos/kif-framework/KIF/issues/660","labels_url":"https://api.github.com/repos/kif-framework/KIF/issues/660/labels{/name}","comments_url":"https://api.github.com/repos/kif-framework/KIF/issues/660/comments","events_url":"https://api.github.com/repos/kif-framework/KIF/issues/660/events","html_url":"https://github.com/kif-framework/KIF/issues/660","id":82589045,"number":660,"title":"Inject dependency into viewcontroller?","user":{"login":"drhr","id":723338,"avatar_url":"https://avatars.githubusercontent.com/u/723338?v=3","gravatar_id":"","url":"https://api.github.com/users/drhr","html_url":"https://github.com/drhr","followers_url":"https://api.github.com/users/drhr/followers","following_url":"https://api.github.com/users/drhr/following{/other_user}","gists_url":"https://api.github.com/users/drhr/gists{/gist_id}","starred_url":"https://api.github.com/users/drhr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drhr/subscriptions","organizations_url":"https://api.github.com/users/drhr/orgs","repos_url":"https://api.github.com/users/drhr/repos","events_url":"https://api.github.com/users/drhr/events{/privacy}","received_events_url":"https://api.github.com/users/drhr/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-29T21:10:39Z","updated_at":"2015-06-01T16:08:43Z","closed_at":"2015-06-01T16:08:43Z","body":"I need to inject different dependencies into different tests. For example, my view controller by default inits with a concrete class that calls a remote service. My unit tests are able to inject stub classes that automate those remote services and vary the expected responses. So  a Login service might have an \"Accepting\" stub that immediately returns a successful login response, and perhaps a \"Rejecting\" stub to simulate failure.\r\n\r\nWith KIF, I can't seem to figure out how to get access to the view controllers that are actually launching, and what is actually being inspected by KIF by when I try to access the views by their accessibility labels.\r\n\r\nIf I try to use `runBlock` to set up a rootViewController on the window, it doesn't seem to work, and the test case carries on using the default  concrete class within my UIViewController that performs remote functions. Obviously I don't want this.  I get the argument that it's not what users are seeing... but ultimately, I need integration tests that work across the boundaries of my application architecture WHILE using stubs (or not using stubs, either way - the framework shouldn't necessarily care, should it?).\r\n\r\nAny thoughts on how to achieve this?"},"comment":{"url":"https://api.github.com/repos/kif-framework/KIF/issues/comments/107611889","html_url":"https://github.com/kif-framework/KIF/issues/660#issuecomment-107611889","issue_url":"https://api.github.com/repos/kif-framework/KIF/issues/660","id":107611889,"user":{"login":"drhr","id":723338,"avatar_url":"https://avatars.githubusercontent.com/u/723338?v=3","gravatar_id":"","url":"https://api.github.com/users/drhr","html_url":"https://github.com/drhr","followers_url":"https://api.github.com/users/drhr/followers","following_url":"https://api.github.com/users/drhr/following{/other_user}","gists_url":"https://api.github.com/users/drhr/gists{/gist_id}","starred_url":"https://api.github.com/users/drhr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drhr/subscriptions","organizations_url":"https://api.github.com/users/drhr/orgs","repos_url":"https://api.github.com/users/drhr/repos","events_url":"https://api.github.com/users/drhr/events{/privacy}","received_events_url":"https://api.github.com/users/drhr/received_events","type":"User","site_admin":false},"created_at":"2015-06-01T16:08:43Z","updated_at":"2015-06-01T16:08:43Z","body":"Yeah that seems to make the most sense.  I just wasn't sure if there was an api for it that would be more appropriate. I tried a ViewController extension class from somewhere else on github only to see my storyboard initializing two or three times and was very confused.."}}