clean up some tests
This commit is contained in:
parent
df9f763b45
commit
6ca0ba2297
@ -186,7 +186,7 @@ describe AVM::Image do
|
|||||||
end
|
end
|
||||||
|
|
||||||
describe '.from_xml' do
|
describe '.from_xml' do
|
||||||
let(:image) { AVM::Image.from_xml(File.read(file_path)) }
|
let!(:image) { AVM::Image.from_xml(File.read(file_path)) }
|
||||||
|
|
||||||
subject { image }
|
subject { image }
|
||||||
|
|
||||||
@ -316,26 +316,32 @@ describe AVM::Image do
|
|||||||
let(:redshift) { nil }
|
let(:redshift) { nil }
|
||||||
let(:light_years) { nil }
|
let(:light_years) { nil }
|
||||||
|
|
||||||
specify { avm.at_xpath('./avm:Distance').should be_nil }
|
it("should have no distances") { avm.at_xpath('./avm:Distance').should be_nil }
|
||||||
end
|
end
|
||||||
|
|
||||||
context "redshift only" do
|
context "redshift only" do
|
||||||
let(:light_years) { nil }
|
let(:light_years) { nil }
|
||||||
|
|
||||||
specify { avm.at_xpath('./avm:Distance/rdf:Seq/rdf:li[1]').text.should == '-' }
|
it "should have redshift only" do
|
||||||
specify { avm.at_xpath('./avm:Distance/rdf:Seq/rdf:li[2]').text.should == redshift }
|
avm.at_xpath('./avm:Distance/rdf:Seq/rdf:li[1]').text.should == '-'
|
||||||
|
avm.at_xpath('./avm:Distance/rdf:Seq/rdf:li[2]').text.should == redshift
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "light years only" do
|
context "light years only" do
|
||||||
let(:redshift) { nil }
|
let(:redshift) { nil }
|
||||||
|
|
||||||
specify { avm.at_xpath('./avm:Distance/rdf:Seq/rdf:li[1]').text.should == light_years }
|
it "should should have light years but not redshift" do
|
||||||
specify { avm.at_xpath('./avm:Distance/rdf:Seq/rdf:li[2]').should be_nil }
|
avm.at_xpath('./avm:Distance/rdf:Seq/rdf:li[1]').text.should == light_years
|
||||||
|
avm.at_xpath('./avm:Distance/rdf:Seq/rdf:li[2]').should be_nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "redshift and light years" do
|
context "redshift and light years" do
|
||||||
specify { avm.at_xpath('./avm:Distance/rdf:Seq/rdf:li[1]').text.should == light_years }
|
it "should have both light years and redshift" do
|
||||||
specify { avm.at_xpath('./avm:Distance/rdf:Seq/rdf:li[2]').text.should == redshift }
|
avm.at_xpath('./avm:Distance/rdf:Seq/rdf:li[1]').text.should == light_years
|
||||||
|
avm.at_xpath('./avm:Distance/rdf:Seq/rdf:li[2]').text.should == redshift
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user