Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
georgejecook
Level 7

Announcing Rooibos: Unit testing framework for roku.

Fellow roku developers,

I'm pleased to announce Rooibos unit testing framework. It's a fun, easy to use, and extremely powerful Brightscript unit testing framework, inspired by mocha for js.

It's open source, supported, and used in several production environments. The code is a major rewrite of the official unit testing framework for Roku: It is compatible with existing test suites.

In addition, the framework offers many more features, which make Test Drive Development, and all manner of testing far easier and more efficient.

You can incorporate it into your projects, running your existing test suites and writing more tests today!

Go visit the github: https://www.youtube.com/playlist?list=PLJRLV4QDx83vsYMD9bIs-cjoDXmNmO8Jv

Please raise issues and feel free to submit PR's. I'm actively supporting the library. You can get support on the Roku developers slack group: https://join.slack.com/t/rokudevelopers ... TVhNzJiY2M
George Cook
https://linkedin.com/in/georgejecook/
Roku developers slack group (http://tiny.cc/nrdf0y) : georgejecook

Contact me on roku developer slack group, or via pm to discuss consultancy/work opportunities/rooibos unit testing framework
0 Kudos
4 Replies
BVatBBOD
Level 7

Re: Announcing Rooibos: Unit testing framework for roku.

Been using this for my new project. Has worked great so far. Even given some feedback and submitted a PR and filed some issues on github.

If you want to start using this and are stuck or need help, hit me up on the Roku developers slack group. https://join.slack.com/t/rokudevelopers ... TVhNzJiY2M
Join the Roku Developers Slack Workspace for quicker help and great dev collaboration: http://tiny.cc/nrdf0y
0 Kudos
georgejecook
Level 7

Re: Announcing Rooibos: Unit testing framework for roku.

Some updates - I've added 2 new videos to the training series - there's an hour's worth of rooibos training for your viewing delight!

https://www.youtube.com/playlist?list=P ... oDXmNmO8Jv

The new videos will teach you how to write tests (103) and how to use the powerful stubs and mocks mechanism (104) to achieve highly efficient and effective unit and integration testing.

I've also added backward compatibility for the existing unit testing framework - you're running out of excuses to not be achieving testing zen Smiley Happy

Go check it out: https://github.com/georgejecook/rooibos
George Cook
https://linkedin.com/in/georgejecook/
Roku developers slack group (http://tiny.cc/nrdf0y) : georgejecook

Contact me on roku developer slack group, or via pm to discuss consultancy/work opportunities/rooibos unit testing framework
0 Kudos
georgejecook
Level 7

Re: Announcing Rooibos: Unit testing framework for roku.

If you follow the documentation and video tutorial, you will quickly understand how to write tests like this, which will allow you to quickly mock http services, and device apis:

'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'@It tests getVideosRealExample
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

'@Test basic test
'@Params["mp4", ["a", "b", "c"]]
'@Params["mp3", ["a", "b", "c", "d", "e"]]
function VMT__getVideosRealExample_basic(videoType, returnedJson) as void
  getjsonMock = m.expectOnce(m.httpService, "getJson", [m.ignoreValue, videoType], returnedJson, true)

  videos = m.module.getVideosRealExample(videoType)
  
  m.AssertArrayContainsSubset(videos, returnedJson)
end function

Which results in the following test output:

George Cook
https://linkedin.com/in/georgejecook/
Roku developers slack group (http://tiny.cc/nrdf0y) : georgejecook

Contact me on roku developer slack group, or via pm to discuss consultancy/work opportunities/rooibos unit testing framework
0 Kudos
rymawby
Level 7

Re: Announcing Rooibos: Unit testing framework for roku.

George this looks awesome! Thanks for developing it - I'm going to give it a go over the next couple of days. 
---
Blogging Roku stuff at http://rymawby.com
---
0 Kudos