SciRuby/distribution

View on GitHub
data/template/spec.erb

Summary

Maintainability
Test Coverage
require File.expand_path(File.dirname(__FILE__)+"/spec_helper.rb")
  
describe Distribution::<%= distribution.capitalize %> do
    
  shared_examples_for "<%= distribution %> engine" do
    it "should return correct pdf" do
      if @engine.respond_to? :pdf
      else
        pending("No #{@engine}.pdf")
      end
    end
    
    it "should return correct cdf" do
      if @engine.respond_to? :cdf
      else
        pending("No #{@engine}.cdf")
      end
    end
  
    
    it "should return correct p_value" do
      if @engine.respond_to? :p_value
      else
        pending("No #{@engine}.cdf")
      end
    end
  end
  

  describe "singleton" do
    before do
      @engine=Distribution::<%= distribution.capitalize %>
    end
    it_should_behave_like "<%= distribution %> engine"
  end
  
  describe Distribution::<%= distribution.capitalize %>::Ruby_ do
    before do
      @engine=Distribution::<%= distribution.capitalize %>::Ruby_
    end
    it_should_behave_like "<%= distribution %> engine"
    
  end
  
  if Distribution.has_gsl?
    describe Distribution::<%= distribution.capitalize %>::GSL_ do
      before do
        @engine=Distribution::<%= distribution.capitalize %>::GSL_
      end
      it_should_behave_like "<%= distribution %> engine"
    end
  end
  
  
end