summaryrefslogtreecommitdiff
path: root/spec/ruby/core/string/crypt_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/string/crypt_spec.rb')
-rw-r--r--spec/ruby/core/string/crypt_spec.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/spec/ruby/core/string/crypt_spec.rb b/spec/ruby/core/string/crypt_spec.rb
index 66161b280f..7a0f8835f2 100644
--- a/spec/ruby/core/string/crypt_spec.rb
+++ b/spec/ruby/core/string/crypt_spec.rb
@@ -15,7 +15,7 @@ describe "String#crypt" do
end
it "raises Errno::EINVAL when the salt is shorter than 29 characters" do
- lambda { "mypassword".crypt("$2a$04$0WVaz0pV3jzfZ5G5tpmHW") }.should raise_error(Errno::EINVAL)
+ -> { "mypassword".crypt("$2a$04$0WVaz0pV3jzfZ5G5tpmHW") }.should raise_error(Errno::EINVAL)
end
it "calls #to_str to converts the salt arg to a String" do
@@ -73,7 +73,7 @@ describe "String#crypt" do
end
it "raises an ArgumentError when the string contains NUL character" do
- lambda { "poison\0null".crypt("aa") }.should raise_error(ArgumentError)
+ -> { "poison\0null".crypt("aa") }.should raise_error(ArgumentError)
end
it "calls #to_str to converts the salt arg to a String" do
@@ -103,16 +103,16 @@ describe "String#crypt" do
end
it "raises an ArgumentError when the salt is shorter than two characters" do
- lambda { "hello".crypt("") }.should raise_error(ArgumentError)
- lambda { "hello".crypt("f") }.should raise_error(ArgumentError)
- lambda { "hello".crypt("\x00\x00") }.should raise_error(ArgumentError)
- lambda { "hello".crypt("\x00a") }.should raise_error(ArgumentError)
- lambda { "hello".crypt("a\x00") }.should raise_error(ArgumentError)
+ -> { "hello".crypt("") }.should raise_error(ArgumentError)
+ -> { "hello".crypt("f") }.should raise_error(ArgumentError)
+ -> { "hello".crypt("\x00\x00") }.should raise_error(ArgumentError)
+ -> { "hello".crypt("\x00a") }.should raise_error(ArgumentError)
+ -> { "hello".crypt("a\x00") }.should raise_error(ArgumentError)
end
end
it "raises a type error when the salt arg can't be converted to a string" do
- lambda { "".crypt(5) }.should raise_error(TypeError)
- lambda { "".crypt(mock('x')) }.should raise_error(TypeError)
+ -> { "".crypt(5) }.should raise_error(TypeError)
+ -> { "".crypt(mock('x')) }.should raise_error(TypeError)
end
end