aboutsummaryrefslogtreecommitdiffstats
path: root/spec/rubyspec/library/mathn/integer/from_prime_division_spec.rb
blob: 47aaf4779742821d6e34c0e1aedc5ebd801a77e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
require File.expand_path('../../../../spec_helper', __FILE__)

ruby_version_is ''...'2.5' do
  require 'mathn'

  describe "Integer.from_prime_division" do
    it "reverses a prime factorization of an integer" do
      Integer.from_prime_division([[2, 1], [3, 2], [7, 1]]).should == 126
    end
  end
end