Sha256: c71557247c2c4638de0d0e83608b6e0e55fe6f10af28e482c7fdc0f8c33b28da

Contents?: true

Size: 1.02 KB

Versions: 6

Compression:

Stored size: 1.02 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

include Fathom

describe Fact do
  before do
    @f = Fact.new(
      :value => 2, 
      :name => "Some Fact", 
      :description => "Just a demonstration of what a good fact may look like.  Facts are really about things that are certain--there are 7 days in a week, that sort of thing.  Too often I was creating a PlausibleRange with the min and max to the same value."
    )
  end
  
  it "should be a Node" do
    Fact.ancestors.should be_include(Fathom::Node)
  end
  
  it "should take a value (rather than values)" do
    @f.value.should eql(2)
  end
  
  it "should return the value for rand" do
    @f.rand.should eql(2)
  end
  
  it "should have removed the distribution and values methods" do
    @f.should_not be_respond_to(:values)
    @f.should_not be_respond_to(:distribution)
    @n = Node.new(:distribution => :standard, :values => [1,2,3])
    @n.values.should eql([1,2,3])
    @n.distribution.should eql(Fathom::Distributions::Gaussian)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
fathom-0.3.7 spec/fathom/node/fact_spec.rb
fathom-0.3.6 spec/fathom/node/fact_spec.rb
fathom-0.3.4 spec/fathom/node/fact_spec.rb
fathom-0.3.3 spec/fathom/node/fact_spec.rb
fathom-0.3.2 spec/fathom/node/fact_spec.rb
fathom-0.3.1 spec/fathom/node/fact_spec.rb