{"action":"opened","issue":{"url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/issues/542","labels_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/issues/542/labels{/name}","comments_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/issues/542/comments","events_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/issues/542/events","html_url":"https://github.com/matlab2tikz/matlab2tikz/issues/542","id":58510497,"number":542,"title":"Global state mocking","user":{"login":"egeerardyn","id":177360,"avatar_url":"https://avatars.githubusercontent.com/u/177360?v=3","gravatar_id":"","url":"https://api.github.com/users/egeerardyn","html_url":"https://github.com/egeerardyn","followers_url":"https://api.github.com/users/egeerardyn/followers","following_url":"https://api.github.com/users/egeerardyn/following{/other_user}","gists_url":"https://api.github.com/users/egeerardyn/gists{/gist_id}","starred_url":"https://api.github.com/users/egeerardyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/egeerardyn/subscriptions","organizations_url":"https://api.github.com/users/egeerardyn/orgs","repos_url":"https://api.github.com/users/egeerardyn/repos","events_url":"https://api.github.com/users/egeerardyn/events{/privacy}","received_events_url":"https://api.github.com/users/egeerardyn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-22T17:31:11Z","updated_at":"2015-02-22T17:31:11Z","closed_at":null,"body":"We should write some code to mock in global state, e.g.\r\n- the DPI of the screen used\r\n- the values in `get(0, 'Default')` and `get(0, 'Factory')`\r\n- maybe some others\r\n\r\nE.g. a thin wrapper around the standard mechanisms to be able to inject our own state instead of the global state.\r\n\r\nEspecially for `get(0, 'Default')` etc. we might also consider having a mechanism to retrieve all those settings, set them to empty and reset to the retrieved values. This would considerably increase testability and the reliability of our test cases (see also #485), certainly over different machines and environments."}}