Sha256: fc372f56ee30751d0cdff07986fe863b3c162f39d3e2cdd16b6a8666b02d4ac5

Contents?: true

Size: 1.49 KB

Versions: 6

Compression:

Stored size: 1.49 KB

Contents

require 'spec_helper'
require 'genomer-plugin-view/gff'

describe GenomerPluginView::Gff do

  describe "#run" do

    let(:annotations){ [] }

    let(:flags){ {} }

    before(:each) do
      stub(subject).annotations do
        annotations
      end
      stub(subject).flags do
        flags
      end
    end

    subject do
      described_class.new([],{})
    end

    describe "with no annotations or flags" do

      it "should return the header line" do
        subject.run.should == "##gff-version 3\n"
      end

    end

    describe "with one gene annotation" do

      let(:annotations){ [gene] }

      it "should return a single gene gff entry " do
        subject.run.should == <<-EOS.unindent
        ##gff-version 3
        .\t.\tgene\t1\t3\t.\t+\t1\t.
        EOS
      end

    end

    describe "with two gene annotations" do

      let(:annotations) do
        [
          gene,
          gene(:start => 4, :end => 6)
        ]
      end

      it "should return a single gene gff entry " do
        subject.run.should == <<-EOS.unindent
        ##gff-version 3
        .\t.\tgene\t1\t3\t.\t+\t1\t.
        .\t.\tgene\t4\t6\t.\t+\t1\t.
        EOS
      end

    end

    describe "with the identifier flag" do

      let(:flags){ {:identifier => 'genome'} }

      let(:annotations){ [gene] }

      it "should return a single gene gff entry " do
        subject.run.should == <<-EOS.unindent
        ##gff-version 3
        genome\t.\tgene\t1\t3\t.\t+\t1\t.
        EOS
      end

    end

  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
genomer-plugin-view-0.1.0 spec/genomer-view-plugin/gff_spec.rb
genomer-plugin-view-0.0.7 spec/genomer-view-plugin/gff_spec.rb
genomer-plugin-view-0.0.6 spec/genomer-view-plugin/gff_spec.rb
genomer-plugin-view-0.0.5 spec/genomer-view-plugin/gff_spec.rb
genomer-plugin-view-0.0.4 spec/genomer-view-plugin/gff_spec.rb
genomer-plugin-view-0.0.3 spec/genomer-view-plugin/gff_spec.rb