more image work
This commit is contained in:
parent
d3113968a9
commit
179d017f37
@ -30,6 +30,10 @@ module AVM
|
|||||||
Time.parse(@options[:date])
|
Time.parse(@options[:date])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def distance
|
||||||
|
[ light_years, redshift ]
|
||||||
|
end
|
||||||
|
|
||||||
def self.from_xml(string)
|
def self.from_xml(string)
|
||||||
document = AVM::XMP.from_string(string)
|
document = AVM::XMP.from_string(string)
|
||||||
|
|
||||||
|
@ -20,7 +20,9 @@ describe AVM::Image do
|
|||||||
:date => date,
|
:date => date,
|
||||||
:id => id,
|
:id => id,
|
||||||
:type => type,
|
:type => type,
|
||||||
:image_quality => image_quality
|
:image_quality => image_quality,
|
||||||
|
:redshift => redshift,
|
||||||
|
:light_years => light_years
|
||||||
} }
|
} }
|
||||||
|
|
||||||
let(:title) { 'My title' }
|
let(:title) { 'My title' }
|
||||||
@ -33,6 +35,8 @@ describe AVM::Image do
|
|||||||
let(:id) { 'ID' }
|
let(:id) { 'ID' }
|
||||||
let(:type) { 'Obvservation' }
|
let(:type) { 'Obvservation' }
|
||||||
let(:image_quality) { 'Good' }
|
let(:image_quality) { 'Good' }
|
||||||
|
let(:redshift) { 'Redshift' }
|
||||||
|
let(:light_years) { 'Light years' }
|
||||||
|
|
||||||
its(:creator) { should be_a_kind_of(AVM::Creator) }
|
its(:creator) { should be_a_kind_of(AVM::Creator) }
|
||||||
its(:title) { should == title }
|
its(:title) { should == title }
|
||||||
@ -45,6 +49,10 @@ describe AVM::Image do
|
|||||||
its(:id) { should == id }
|
its(:id) { should == id }
|
||||||
its(:image_type) { should == type }
|
its(:image_type) { should == type }
|
||||||
its(:image_quality) { should == image_quality }
|
its(:image_quality) { should == image_quality }
|
||||||
|
its(:redshift) { should == redshift }
|
||||||
|
its(:light_years) { should == light_years }
|
||||||
|
|
||||||
|
its(:distance) { should == [ light_years, redshift ] }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#to_xml' do
|
describe '#to_xml' do
|
||||||
|
Loading…
Reference in New Issue
Block a user