{"action":"created","issue":{"url":"https://api.github.com/repos/utPLSQL/utPLSQL/issues/130","repository_url":"https://api.github.com/repos/utPLSQL/utPLSQL","labels_url":"https://api.github.com/repos/utPLSQL/utPLSQL/issues/130/labels{/name}","comments_url":"https://api.github.com/repos/utPLSQL/utPLSQL/issues/130/comments","events_url":"https://api.github.com/repos/utPLSQL/utPLSQL/issues/130/events","html_url":"https://github.com/utPLSQL/utPLSQL/issues/130","id":196435778,"number":130,"title":"Stubbing of procedure/function","user":{"login":"morty321","id":24654299,"avatar_url":"https://avatars.githubusercontent.com/u/24654299?v=3","gravatar_id":"","url":"https://api.github.com/users/morty321","html_url":"https://github.com/morty321","followers_url":"https://api.github.com/users/morty321/followers","following_url":"https://api.github.com/users/morty321/following{/other_user}","gists_url":"https://api.github.com/users/morty321/gists{/gist_id}","starred_url":"https://api.github.com/users/morty321/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/morty321/subscriptions","organizations_url":"https://api.github.com/users/morty321/orgs","repos_url":"https://api.github.com/users/morty321/repos","events_url":"https://api.github.com/users/morty321/events{/privacy}","received_events_url":"https://api.github.com/users/morty321/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-19T15:07:09Z","updated_at":"2016-12-20T05:14:01Z","closed_at":null,"body":"Hello,\r\n\r\nI've used utPLSQL for a time now, and while I have enjoyed using it, one thing I am missing is the ability to stub procedures and/or functions. \r\n\r\nAs an over-simplified example I have a function (foo) and a procedure (bar). \"bar\" prints out the result of \"foo\". \"foo\" can easily be unit tested as it only relies on itself and is not a problem. \r\n\r\nThe problem however is \"bar\" as the functionality of \"bar\" depends on the functionality of \"foo\". Now, depending on the complexity of the code it means I would have to not only test the paths that \"bar\" takes, but also all the paths that the inputs into \"bar\" would take once they path through \"foo\". \r\n\r\nAt this point it is not possible to unit test \"bar\", and all the testing for \"bar\" is integration testing. It can never be independent because it depends on the functionality of \"foo\". Ideally I would want to be able to stub foo and decide what the outputs of \"foo\" is so that any functionality foo otherwise has is decided at the runtime of the unit test. \r\n```\r\nfunction foo(return_this in boolean)\r\nreturn boolean\r\nis\r\nbegin\r\n\treturn return_this\r\nend foo;\r\n\r\nprocedure bar(input_boolean in boolean)\r\nis\r\nbegin\r\n\tdbms_output.put_line(foo(return_this => input_boolean));\r\nend bar;\r\n```\r\nThis is merely a suggestion to what I believe would be a nice implementation to what is already a great testing package. I tried looking over the documentation as well as planned changes for version 3 but was unable to find any hinting at stubbing. Please let me know if such functionality already exists or if there are any workarounds for these type of issues. Otherwise I hope this would be considered for the development on utPLSQL. "},"comment":{"url":"https://api.github.com/repos/utPLSQL/utPLSQL/issues/comments/268156898","html_url":"https://github.com/utPLSQL/utPLSQL/issues/130#issuecomment-268156898","issue_url":"https://api.github.com/repos/utPLSQL/utPLSQL/issues/130","id":268156898,"user":{"login":"Pazus","id":11403278,"avatar_url":"https://avatars.githubusercontent.com/u/11403278?v=3","gravatar_id":"","url":"https://api.github.com/users/Pazus","html_url":"https://github.com/Pazus","followers_url":"https://api.github.com/users/Pazus/followers","following_url":"https://api.github.com/users/Pazus/following{/other_user}","gists_url":"https://api.github.com/users/Pazus/gists{/gist_id}","starred_url":"https://api.github.com/users/Pazus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pazus/subscriptions","organizations_url":"https://api.github.com/users/Pazus/orgs","repos_url":"https://api.github.com/users/Pazus/repos","events_url":"https://api.github.com/users/Pazus/events{/privacy}","received_events_url":"https://api.github.com/users/Pazus/received_events","type":"User","site_admin":false},"created_at":"2016-12-20T05:14:01Z","updated_at":"2016-12-20T05:14:01Z","body":"Hello, @morty321 \r\n\r\nCurrently there is no workaround provided by the framework. Stabbing is mostly limited by the language, but we'll think what can be done. If you have any ideas how stabbing can be implemented, please let us know."}}
{"actor":{"display_login":"Pazus"}}