spec/signore/database_spec.rb in signore-0.2.3 vs spec/signore/database_spec.rb in signore-0.2.4
- old
+ new
@@ -8,20 +8,15 @@
require_relative '../../lib/signore/tags'
module Signore
describe Database do
describe '#<<' do
- let(:file) { Tempfile.new('') }
- let(:sig) { Signature.new(text) }
- let(:text) { 'Normaliser Unix c’est comme pasteuriser le camembert.' }
-
it 'saves the provided signature to disk' do
- Database.new(path: Pathname.new(file.path)) << sig
- file.read.must_include text
- end
-
- it 'returns the saved signature' do
- Database.new(path: Pathname.new(file.path)).<<(sig).must_equal sig
+ text = 'Normaliser Unix c’est comme pasteuriser le camembert.'
+ sig = Signature.new(text)
+ path = Pathname.new(Tempfile.new('').path)
+ Database.new(path: path) << sig
+ path.read.must_include text
end
end
describe '#find' do
let(:database) { Database.new(path: path, sig_finder: sig_finder) }