Sha256: 2e38eb5a317c7d25de9f99c8ab519ebd6c20aa8bfdbd45d1eabd32c80a948d69

Contents?: true

Size: 1.5 KB

Versions: 1

Compression:

Stored size: 1.5 KB

Contents

require File.join(File.dirname(__FILE__),'..','..','spec_helper')

describe Scaffolder::Test::Annotation do

  describe "initialization" do

    context "with all parameters" do
      subject do
        described_class.new(
          :seqname => 'c1', :start => 4, :end     => 6,
          :strand  => '+',  :phase => 1, :feature => 'CDS')
      end

      its(:seqname){should == 'c1'}
      its(:start)  {should == 4}
      its(:end)    {should == 6}
      its(:strand) {should == '+'}
      its(:phase)  {should == 1}
      its(:feature){should == 'CDS'}
    end

    context "using default parameters" do
      subject do
        described_class.new
      end

      its(:seqname){should == 'record'}
      its(:start)  {should == 1}
      its(:end)    {should == 10}
      its(:strand) {should == '+'}
      its(:phase)  {should == 1}
      its(:feature){should == 'CDS'}
    end

  end

  describe "#to_gff3_record" do

      subject do
        described_class.new.to_gff3_record
      end

      it "should generate a Bio::GFF::GFF3::Record" do
        expected = Bio::GFF::GFF3::Record.new(
          subject.seqname, nil, subject.feature, subject.start,
          subject.end,     nil, subject.strand,  subject.phase)
        subject.should == expected
      end

  end

  describe "#clone" do

    it "should duplicate the internal options state" do
      a = described_class.new
      b = a.clone

      a.instance_variable_get("@options").
        should_not equal(b.instance_variable_get("@options"))
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
scaffolder-test-helpers-0.4.0 spec/scaffolder/test/annotation_spec.rb