Skip to content
This repository has been archived by the owner on Mar 20, 2019. It is now read-only.

Whenbot Channel Creation Guide

M7 edited this page Apr 24, 2012 · 3 revisions

Please note that this page is a work in progress. In the meanwhile, please feel free to ask any questions in the Google Group or via email. Check back later for updates and additional instructions.

6. Channel Creation

6.1 Creating a gem

It's not as hard as you may think. Follow this guide:

6.1.1 Folder Structure

See the folder layout in the lib/channels/developer Channel in the Whenbot App repository.

6.2 Testing

If you're not on the "Test Driven Development" (TDD) train yet, now's your chance! TDD development is highly encouraged for all parts of Whenbot.

6.3.1 Gem Dependencies for Testing

You can pretty much use whatever testing setup you prefer, but here's some suggestions:

  • Test::Unit
  • FactoryGirl (to replace fixtures)
  • Mocha (for mocking and stubbing)
  • Shoulda (for contexts)

To get started, you'll need to set the proper dependencies for your gem.

Use the s.add_development_dependency command to add the above gems.

Side-Note: There's a potential gotcha with Test::Unit that you may or may not encounter: Ruby 1.9 no longer includes Test::Unit. it uses minitest instead. So, if you happen to notice that your error messages for your failing tests aren't particularly helpful, you're probably using minitest.

To fix this, install the test-unit gem and add it to your dependencies.

This may only apply to your normal app development though.

6.4 Sample Trigger Code

See the sample code in the lib/channels/developer Channel in the Whenbot App repository.