spec/ref2bibtex_spec.rb in ref2bibtex-0.0.2 vs spec/ref2bibtex_spec.rb in ref2bibtex-0.0.3
- old
+ new
@@ -32,17 +32,25 @@
end
specify 'a citation that can not be resolved returns false' do
expect(Ref2bibtex.get_doi(CITATIONS[:fifth])).to eq(false)
end
+
+ specify 'a badly formed DOI returns false' do
+ expect(Ref2bibtex.get_doi('asfas')).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
expect(response).to match(/author\s=/)
expect(response).to match(/title\s=/)
expect(response).to match(/year\s=\s2009/)
+ end
+
+ specify 'a bad doi returns false' do
+ expect(Ref2bibtex.get_bibtex('asfasf')).to eq(false)
end
end
specify "a citation that can not be resolved returns false" do
expect(Ref2bibtex.get(CITATIONS[:fifth])).to eq(false)