rollable/spec/rollable/fixed_value.cr
Arthur Poulet 344c6fbb11
Improve lot of data
- Add and fix some test
- Improve api (add some functions)
- Move parsing and to_s functions to sub-directories
- Some fixes on the (to_s / compact / order) Roll's functions
2016-07-13 18:51:23 +02:00

23 lines
551 B
Crystal

describe Rollable::FixedValue do
it "new_die" do
10.times do |i|
n = i - 5
f = Rollable::FixedValue.new_die n
f.should be_a Rollable::Die
f.min.should eq n
f.max.should eq n
f.average.should eq n
f.test.should eq n
end
end
it "new_dice" do
a = Rollable::FixedValue.new_dice 5
b = Rollable::Dice.new(1, Rollable::FixedValue.new_die(5))
a.should eq b
a = Rollable::FixedValue.new_dice -5
b = Rollable::Dice.new(1, Rollable::FixedValue.new_die(-5))
a.should eq b
end
end