<commit_before>require 'spec_helper'

describe Bio::FastQC do
  context "with an example data" do
    before do
      @zipfile = File.join(__dir__, "example_fastqc.zip")
    end

    describe Bio::FastQC::Data do
      before do
        @data = Bio::FastQC::Data.read(@zipfile)
      end

      describe '#read' do
        it 'returns parsed data from zipfile' do
          expect(@data).not_to be_empty
        end
      end
    end

    describe Bio::FastQC::Parser do
      before do
        @data = Bio::FastQC::Data.read(@zipfile)
        @parser = Bio::FastQC::Parser.new(@data)
      end

      describe '#fastqc_version' do
        it 'returns fastqc version as String and not empty' do
          expect(@parser.fastqc_version).to be_instance_of(String)
          expect(@parser.fastqc_version).not_to be_empty
        end
      end

      describe '#filename' do
        it 'returns filename as String and not empty' do
          expect(@parser.filename).to be_instance_of(String)
          expect(@parser.filename).not_to be_empty
        end
      end

      describe '#file_type' do
        it 'returns file type as String and not empty' do
          expect(@parser.file_type).to be_instance_of(String)
          expect(@parser.file_type).not_to be_empty
        end
      end

      describe '#encoding' do
        it 'returns encoding type as String and not empty' do
          expect(@parser.encoding).to be_instance_of(String)
          expect(@parser.encoding).not_to be_empty
        end
      end

      describe '#total_sequences' do
        it 'returns total number of sequences as Fixnum' do
          expect(@parser.total_sequences).to be_instance_of(Fixnum)
        end
      end

      describe '#filtered_sequences' do
        it 'returns number of filtered sequence as Fixnum and not empty' do
          expect(@parser.filtered_sequences).to be_instance_of(Fixnum)
        end
      end

      describe '#sequence_length' do
        it 'returns length of sequence as String and not empty' do
          expect(@parser.sequence_length).to be_instance_of(String)
          expect(@parser.sequence_length).not_to be_empty
        end
      end

      describe '#percent_gc' do
        it 'returns percentage of GC content as Fixnum and not empty' do
          expect(@parser.percent_gc).to be_instance_of(Fixnum)
        end
      end

      describe '#per_base_sequence_quality' do
        before do
          @value = @parser.per_base_sequence_quality
        end

        it 'returns data frame as Array' do
          expect(@value).to be_instance_of(Array)<commit_msg>changed %GC to be returned as Float<commit_after>require 'spec_helper'

describe Bio::FastQC do
  context "with an example data" do
    before do
      @zipfile = File.join(__dir__, "example_fastqc.zip")
    end

    describe Bio::FastQC::Data do
      before do
        @data = Bio::FastQC::Data.read(@zipfile)
      end

      describe '#read' do
        it 'returns parsed data from zipfile' do
          expect(@data).not_to be_empty
        end
      end
    end

    describe Bio::FastQC::Parser do
      before do
        @data = Bio::FastQC::Data.read(@zipfile)
        @parser = Bio::FastQC::Parser.new(@data)
      end

      describe '#fastqc_version' do
        it 'returns fastqc version as String and not empty' do
          expect(@parser.fastqc_version).to be_instance_of(String)
          expect(@parser.fastqc_version).not_to be_empty
        end
      end

      describe '#filename' do
        it 'returns filename as String and not empty' do
          expect(@parser.filename).to be_instance_of(String)
          expect(@parser.filename).not_to be_empty
        end
      end

      describe '#file_type' do
        it 'returns file type as String and not empty' do
          expect(@parser.file_type).to be_instance_of(String)
          expect(@parser.file_type).not_to be_empty
        end
      end

      describe '#encoding' do
        it 'returns encoding type as String and not empty' do
          expect(@parser.encoding).to be_instance_of(String)
          expect(@parser.encoding).not_to be_empty
        end
      end

      describe '#total_sequences' do
        it 'returns total number of sequences as Fixnum' do
          expect(@parser.total_sequences).to be_instance_of(Fixnum)
        end
      end

      describe '#filtered_sequences' do
        it 'returns number of filtered sequence as Fixnum and not empty' do
          expect(@parser.filtered_sequences).to be_instance_of(Fixnum)
        end
      end

      describe '#sequence_length' do
        it 'returns length of sequence as String and not empty' do
          expect(@parser.sequence_length).to be_instance_of(String)
          expect(@parser.sequence_length).not_to be_empty
        end
      end

      describe '#percent_gc' do
        it 'returns percentage of GC content as Float and not empty' do
          expect(@parser.percent_gc).to be_instance_of(Float)
        end
      end

      describe '#per_base_sequence_quality' do
        before do
          @value = @parser.per_base_sequence_quality
        end

        it 'returns data frame as Array' do
          expect(@value).to be_instance_of(Array)
{'fraction_non_alphanumeric': 0.07735124760076775, 'fraction_numerical': 0.0, 'mean_word_length': 2.3001899936668777, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7425726', 'n_tokens_mistral': 1486, 'n_tokens_neox': 1422, 'n_words': 437}