Skip to content

Instantly share code, notes, and snippets.

@envp
Last active February 18, 2016 13:29
Show Gist options
  • Save envp/f57487c7db92409712a6 to your computer and use it in GitHub Desktop.
Save envp/f57487c7db92409712a6 to your computer and use it in GitHub Desktop.
Generic template for distribution test cases
describe Statistical::Distribution::DistNameGoesHere do
describe '.new' do
context 'when called with no arguments'
context 'when upper and lower bounds are specified'
end
describe '#pdf' do
context 'when called with x < lower'
context 'when called with x > upper'
context 'when called with x in [lower, upper]'
end
describe '#cdf' do
context 'when called with x > lower'
context 'when called with x < upper'
context 'when called with x in [lower, upper]'
end
describe '#quantile' do
context 'when called for x > 1'
context 'when called for x < 0'
context 'when called for x in [0, 1]'
end
describe '#mean' do
it 'should return the correct mean'
end
describe '#variance' do
it 'should return the correct variance'
end
describe '#eql?' do
context 'when compared against another DistNameGoesHere distribution'
context 'when compared against any distribution type'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment