scaffolder-test-helpers 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/scaffolder/test/annotation.rb +3 -2
- data/scaffolder-test-helpers.gemspec +2 -2
- data/spec/scaffolder/test/annotation_spec.rb +28 -0
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.1
|
@@ -3,7 +3,7 @@ require 'scaffolder'
|
|
3
3
|
module Scaffolder::Test
|
4
4
|
class Annotation
|
5
5
|
|
6
|
-
[:seqname,:start,:end,:strand,:phase,:feature].each do |attribute|
|
6
|
+
[:seqname,:start,:end,:strand,:phase,:feature,:attributes].each do |attribute|
|
7
7
|
define_method(attribute) do |*arg|
|
8
8
|
unless arg.first
|
9
9
|
return @options[attribute]
|
@@ -27,7 +27,8 @@ module Scaffolder::Test
|
|
27
27
|
def to_gff3_record
|
28
28
|
Bio::GFF::GFF3::Record.new(
|
29
29
|
self.seqname, nil, self.feature, self.start,
|
30
|
-
self.end, nil, self.strand, self.phase
|
30
|
+
self.end, nil, self.strand, self.phase,
|
31
|
+
self.attributes.to_a)
|
31
32
|
end
|
32
33
|
|
33
34
|
end
|
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{scaffolder-test-helpers}
|
8
|
-
s.version = "0.4.
|
8
|
+
s.version = "0.4.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Michael Barton"]
|
12
|
-
s.date = %q{2011-06-
|
12
|
+
s.date = %q{2011-06-13}
|
13
13
|
s.description = %q{Useful Helper methods and classes for testing scaffolder.}
|
14
14
|
s.email = %q{mail@michaelbarton.me.uk}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -32,10 +32,20 @@ describe Scaffolder::Test::Annotation do
|
|
32
32
|
its(:feature){should == 'CDS'}
|
33
33
|
end
|
34
34
|
|
35
|
+
context "setting gff3 attributes" do
|
36
|
+
subject do
|
37
|
+
described_class.new(:attributes => {:ID => 'gene1'}).attributes
|
38
|
+
end
|
39
|
+
|
40
|
+
its([:ID]){should == 'gene1'}
|
41
|
+
end
|
42
|
+
|
35
43
|
end
|
36
44
|
|
37
45
|
describe "#to_gff3_record" do
|
38
46
|
|
47
|
+
context "with default parameters" do
|
48
|
+
|
39
49
|
subject do
|
40
50
|
described_class.new.to_gff3_record
|
41
51
|
end
|
@@ -47,6 +57,24 @@ describe Scaffolder::Test::Annotation do
|
|
47
57
|
subject.should == expected
|
48
58
|
end
|
49
59
|
|
60
|
+
end
|
61
|
+
|
62
|
+
context "with attribute parameters set" do
|
63
|
+
|
64
|
+
subject do
|
65
|
+
described_class.new(:attributes => {'ID' => 'gene1'}).to_gff3_record
|
66
|
+
end
|
67
|
+
|
68
|
+
it "should generate a Bio::GFF::GFF3::Record" do
|
69
|
+
subject.attributes.should == [['ID','gene1']]
|
70
|
+
end
|
71
|
+
|
72
|
+
it "should include the attributes correctly in the gff3 string" do
|
73
|
+
subject.to_s.split.last.should == "ID=gene1"
|
74
|
+
end
|
75
|
+
|
76
|
+
end
|
77
|
+
|
50
78
|
end
|
51
79
|
|
52
80
|
describe "#clone" do
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scaffolder-test-helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 1
|
10
|
+
version: 0.4.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Michael Barton
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-06-
|
18
|
+
date: 2011-06-13 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|