hulu / roca

A command-line tool for running brightscript tests
Apache License 2.0
25 stars 19 forks source link

Spy API? #119

Open elsassph opened 3 years ago

elsassph commented 3 years ago

There is no nice way to spy just one function of an object.

aa = {
   someFun: function()
     ? "doing something"
   end function
}

' what about?

_brs_.spyFunction(aa, "someFun")

aa.someFun("hey") ' does nothing
aa.someFun.called ' true
aa.someFun.calledWith ' ["hey"]
aa.someFun.calledTimes ' 1