Ankur Goel

On hunt of awesomeness!

StatSample - Correcting Tests and Configuration

In previous blog, I mentioned about the Shoulda issues with MiniTest while running the tests. The error which I encounter looks something like this:

1
2
3
4
5
6
7
test git:(master) ✗ ruby test_anovaoneway.rb
test_anovaoneway.rb:3:in `<class:StatsampleAnovaOneWayTestCase>': undefined method `context' for StatsampleAnovaOneWayTestCase:Class (NoMethodError)
  from test_anovaoneway.rb:2:in `<main>'
➜  test git:(master) ✗ ruby test_regression.rb 
test_regression.rb:4:in `<class:StatsampleRegressionTestCase>': undefined method `context' for StatsampleRegressionTestCase:Class (NoMethodError)
  from test_regression.rb:3:in `<main>'
test git:(master)

While adding tests for regression, I worked around it by converting them in pure MiniTest references. I just committed tests for F following similar analogy. I am currently trying to make Shoulda work which could probably save some work involved in conversion.

For setting up StatSample to make it work on multiple Ruby versions, I have configured rvm(tool to manage multiple ruby environments with their own gemsets) with Ruby 1.9.2-p320, 1.9.3. I also committed a clean gemspec for StatSample. I hope to make StatSample compatible for both first, and then fix it for Ruby-1.8.x, as this is usually the workflow which just works.

As always, project can be forked from http://github.com/AnkurGel/statsample.
You can now build it by:

1
2
gem build statsample.gemspec
gem install statsample-1.1.0.2013.gem

Do let me know of any trouble you encounter at ankurgel at gmail dot com.

Cheers!
-Ankur Goel