# Noob help - creating a tests for a plugin

**URL:** <https://www.ruby-forum.com/t/noob-help-creating-a-tests-for-a-plugin/92466>\
**Category:** Rails\
**Created:** [April 19, 2007, 8:22pm UTC](https://www.ruby-forum.com/t/noob-help-creating-a-tests-for-a-plugin/92466 "2007-04-19T20:22:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![john\_old](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9f8e36/32.png) [@john\_old](https://www.ruby-forum.com/u/john_old)\
**Post date:** [April 19, 2007, 8:22pm UTC](https://www.ruby-forum.com/t/noob-help-creating-a-tests-for-a-plugin/92466/1 "2007-04-19T20:22:32Z")

</div>

Hi,

I have just created my first ever plugin and would like to write some  
test’s for it, any suggestions on where to start would be great.

I have this code in my site\_test.rb file

require ‘test/unit’  
require File.dirname( **FILE** ) + ‘/…/lib/site’

class SiteTest \< Test::Unit::TestCase  
include Site

```
def test_getRegion

end

```

end

which I belive relates to this method

module Site  
def getRegion()  
oData = Data.new(@request.env)  
return oData.regionName  
end  
end

I was thinking that it may be possible to test that somthing is always  
returned, how can this be done?

Thanks,  
john
