test/writer_test.rb in symmetric-encryption-3.4.0 vs test/writer_test.rb in symmetric-encryption-3.6.0
- old
+ new
@@ -25,11 +25,11 @@
File.delete(@filename) if File.exist?(@filename)
end
should "encrypt to string stream" do
stream = StringIO.new
- file = SymmetricEncryption::Writer.new(stream, :header => false, :random_key => false, :random_iv => false)
+ file = SymmetricEncryption::Writer.new(stream, header: false, random_key: false, random_iv: false)
written_len = @data.inject(0) {|sum,str| sum + file.write(str)}
assert_equal @data_len, file.size
file.close
assert_equal @data_len, written_len
@@ -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, :header => false, :random_key => false, :random_iv => false) do |file|
+ SymmetricEncryption::Writer.open(@filename, header: false, random_key: false, random_iv: false) do |file|
written_len = @data.inject(0) {|sum,str| sum + file.write(str)}
assert_equal @data_len, file.size
end
assert_equal @data_len, written_len
assert_equal @data_encrypted, File.open(@filename, 'rb') {|f| f.read }