Sha256: f6613e51941c5bfc871407fee5abf5d1379134808574f0c40cbf2ad4f1fcf411

Contents?: true

Size: 1.39 KB

Versions: 1

Compression:

Stored size: 1.39 KB

Contents

require "spec_helper"

module FastaRead
  describe Sequence do
    let(:fasta) {">chr1\nAATCACACGTGCAGGAACCCTTTTCCAAAGGAGGGTCACGCTCACAGCTT\nCTGGAGTAGGACATGGACTTGTCTTTTTGGAGGCCCATCCTCAACGCACC\nACAGTTGACTACATCAAGGTCTGCCTCTGATCTGGTGGGAGTGCTGGGTG\nGTCTGTCTCCACCAGCACTTTGTGGGTGGGCTCTGTCCCCAGGAAATGCT\nC"}
    describe "#real_cstart" do
      context "when @cstart is > 0" do
        subject {Sequence.new(fasta, "12", "5", "200").real_cstart}
        it "should add file header string length" do
          expect(subject).to eq 10
        end
      end
      context "when @cstart is 0" do
        subject {Sequence.new(fasta, "1", "0", "200").real_cstart}
        it "should not subtract 1" do
          expect(subject).to eq 5
        end
      end
    end

    describe "#real_cend" do
      subject {Sequence.new(fasta, "1", "0", "200").real_cend}
      it "should subtract 1 and add file header string length" do
        expect(subject).to eq 204
      end
    end

    describe "#process" do
      subject {Sequence.new(fasta, "1", "0", "200").process}
      describe "with a continuous character stream" do
        it "builds a character sequence" do
          expect(subject).to eq "AATCACACGTGCAGGAACCCTTTTCCAAAGGAGGGTCACGCTCACAGCTTCTGGAGTAGGACATGGACTTGTCTTTTTGGAGGCCCATCCTCAACGCACCACAGTTGACTACATCAAGGTCTGCCTCTGATCTGGTGGGAGTGCTGGGTGGTCTGTCTCCACCAGCACTTTGTGGGTGGGCTCTGTCCCCAGGAAATGCT"
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fasta_read-1.1.0 spec/fasta_read/sequence_spec.rb