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

describe Spittle::ImageData do 
  before do 
      data = [[1,2,3], 
              [4,5,6]]
      @id = Spittle::ImageData.new(:scanline_width => 3, :pixel_width => 3, :data => data)
  end

  it "can fill to a specified height" do 
    result = @id.fill_to_height(3)
    result.should == [[1,2,3], [4,5,6], [0,0,0]]
  end
  it "has scanline width and pixel width attributes" do 
    @id.scanline_width.should == 3
    @id.pixel_width.should == 3
  end

  it "can give you any arbitrary row in the data set" do 
    @id[0].should == [1,2,3]
    @id.scanline(0).should == [1,2,3]
  end

  it "has an empty array by default" do 
    id = Spittle::ImageData.new
    id.empty?.should be_true
  end

  it "should return nil when asked for an index that doesn't exist" do 
    id = Spittle::ImageData.new
    id[0].should be_nil
  end

  it "can be assigned a row" do 
    @id[0] = [1,2,3]
    @id[0].should == [1,2,3]
  end

  it "behaves like an array" do 

    @id << [1,2,3]
    @id.last.should == [1,2,3]

    @id.size.should == 3
  end

  it "will return the last scanline given a current index" do 
    @id.last_scanline(1).should == [1,2,3]
  end

  it "always transforms data to Row objects" do 
    @id
  end
end<commit_msg>removing empty test<commit_after>require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe Spittle::ImageData do 
  before do 
      data = [[1,2,3], 
              [4,5,6]]
      @id = Spittle::ImageData.new(:scanline_width => 3, :pixel_width => 3, :data => data)
  end

  it "can fill to a specified height" do 
    result = @id.fill_to_height(3)
    result.should == [[1,2,3], [4,5,6], [0,0,0]]
  end
  it "has scanline width and pixel width attributes" do 
    @id.scanline_width.should == 3
    @id.pixel_width.should == 3
  end

  it "can give you any arbitrary row in the data set" do 
    @id[0].should == [1,2,3]
    @id.scanline(0).should == [1,2,3]
  end

  it "has an empty array by default" do 
    id = Spittle::ImageData.new
    id.empty?.should be_true
  end

  it "should return nil when asked for an index that doesn't exist" do 
    id = Spittle::ImageData.new
    id[0].should be_nil
  end

  it "can be assigned a row" do 
    @id[0] = [1,2,3]
    @id[0].should == [1,2,3]
  end

  it "behaves like an array" do 
    @id << [1,2,3]
    @id.last.should == [1,2,3]

    @id.size.should == 3
  end

  it "will return the last scanline given a current index" do 
    @id.last_scanline(1).should == [1,2,3]
  end
end
{'fraction_non_alphanumeric': 0.14263384134427512, 'fraction_numerical': 0.03751465416178194, 'mean_word_length': 2.78698224852071, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, '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': '6577357', 'n_tokens_mistral': 1011, 'n_tokens_neox': 952, 'n_words': 283}