more image work

This commit is contained in:
John Bintz 2011-03-11 14:04:50 -05:00
parent d3113968a9
commit 179d017f37
2 changed files with 13 additions and 1 deletions

View File

@ -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)

View File

@ -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