<commit_before>require File.dirname(__FILE__) + '/../../spec_helper'

ruby_version_is "1.9" do
  describe "Numeric#denominator" do
    # The Numeric child classes override this method, so their behaviour is
    # specified in the appropriate place
    before(:each) do
      @numbers = [
        20,             # Integer
        99999999**99,   # Bignum
      ] 
    end

    it "returns 1" do
      @numbers.each {|number| number.denominator.should == 1}
    end  
  end
end
<commit_msg>Numeric#denominator: Works with Numeric subclasses.<commit_after>require File.dirname(__FILE__) + '/../../spec_helper'

ruby_version_is "1.9" do
  describe "Numeric#denominator" do
    # The Numeric child classes override this method, so their behaviour is
    # specified in the appropriate place
    before(:each) do
      @numbers = [
        20,             # Integer
        99999999**99,   # Bignum
      ] 
    end

    it "returns 1" do
      @numbers.each {|number| number.denominator.should == 1}
    end  

    it "works with Numeric subclasses" do
      rational = mock_numeric('rational')
      rational.should_receive(:denominator).and_return(:denominator)
      numeric = mock_numeric('numeric')
      numeric.should_receive(:to_r).and_return(rational)
      numeric.denominator.should == :denominator
    end
  end
end

{'fraction_non_alphanumeric': 0.10196374622356495, 'fraction_numerical': 0.02416918429003021, 'mean_word_length': 2.670360110803324, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2468409', 'n_tokens_mistral': 432, 'n_tokens_neox': 391, 'n_words': 107}