spec/kumogata_crypt_spec.rb in kumogata-0.5.10 vs spec/kumogata_crypt_spec.rb in kumogata-0.5.11
- old
+ new
@@ -1,15 +1,16 @@
describe Kumogata::Crypt do
it 'encrypt string' do
- encrypted = Kumogata::Crypt.encrypt("my_password", "jugem jugem")
- decrypted = Kumogata::Crypt.decrypt("my_password", encrypted)
+ encrypted = Kumogata::Crypt.encrypt("my_password", "jugem jugem")
+ decrypted = Kumogata::Crypt.decrypt("my_password", encrypted)
expect(decrypted).to eq("jugem jugem")
end
it 'encrypt long string' do
- encrypted = Kumogata::Crypt.encrypt("my_password", "jugem jugem" * 10240)
- decrypted = Kumogata::Crypt.decrypt("my_password", encrypted)
- expect(decrypted).to eq("jugem jugem" * 10240)
+ len = (RUBY_PLATFORM =~ /darwin/) ? 1 : 10
+ encrypted = Kumogata::Crypt.encrypt("my_password", "jugem jugem" * 1024 * len)
+ decrypted = Kumogata::Crypt.decrypt("my_password", encrypted)
+ expect(decrypted).to eq("jugem jugem" * 1024 * len)
end
it 'make password' do
passwd = Kumogata::Crypt.mkpasswd(16)
expect(passwd).to be_kind_of(String)