spec/ref2bibtex_spec.rb in ref2bibtex-0.0.1 vs spec/ref2bibtex_spec.rb in ref2bibtex-0.0.2
- old
+ new
@@ -28,10 +28,14 @@
context '#get_doi' do
specify 'Ref2bibtex.get_doi() takes a full citation and returns a string' do
expect(Ref2bibtex.get_doi(CITATIONS[:first])).to eq('http://dx.doi.org/10.3897/zookeys.20.205')
end
+
+ specify 'a citation that can not be resolved returns false' do
+ expect(Ref2bibtex.get_doi(CITATIONS[:fifth])).to eq(false)
+ end
end
context '#get_bibtex' do
let(:response) { Ref2bibtex.get_bibtex('http://dx.doi.org/10.3897/zookeys.20.205')}
specify 'Ref2bibtex.get_bibtex() takes a full citation and returns bibtex' do
@@ -39,7 +43,10 @@
expect(response).to match(/title\s=/)
expect(response).to match(/year\s=\s2009/)
end
end
+ specify "a citation that can not be resolved returns false" do
+ expect(Ref2bibtex.get(CITATIONS[:fifth])).to eq(false)
+ end
end