test/writer_test.rb in symmetric-encryption-0.6.1 vs test/writer_test.rb in symmetric-encryption-0.7.0
- old
+ new
@@ -29,11 +29,11 @@
File.delete(@filename) if File.exist?(@filename)
end
should "encrypt to string stream" do
stream = StringIO.new
- file = SymmetricEncryption::Writer.new(stream)
+ file = SymmetricEncryption::Writer.new(stream, :header => false)
written_len = @data.inject(0) {|sum,str| sum + file.write(str)}
file.close
assert_equal @data_len, written_len
assert_equal @data_encrypted, stream.string
@@ -48,10 +48,10 @@
assert_equal @data_len, written_len
end
should "encrypt to file using .open" do
written_len = nil
- SymmetricEncryption::Writer.open(@filename) do |file|
+ SymmetricEncryption::Writer.open(@filename, :header => false) do |file|
written_len = @data.inject(0) {|sum,str| sum + file.write(str)}
end
assert_equal @data_len, written_len
assert_equal @data_encrypted, File.read(@filename)
end